qemacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemacs-devel] Changes to qemacs/shell.c


From: Charlie Gordon
Subject: [Qemacs-devel] Changes to qemacs/shell.c
Date: Wed, 11 May 2005 08:13:57 -0400

Index: qemacs/shell.c
diff -u qemacs/shell.c:1.13 qemacs/shell.c:1.14
--- qemacs/shell.c:1.13 Mon May  9 09:10:38 2005
+++ qemacs/shell.c      Wed May 11 12:13:56 2005
@@ -144,7 +144,7 @@
     if (pid == 0) {
         /* child process */
         nb_fds = getdtablesize();
-        for(i=0;i<nb_fds;i++)
+        for (i = 0; i < nb_fds; i++)
             close(i);
         /* open pseudo tty for standard i/o */
         open(tty_name, O_RDWR);
@@ -370,11 +370,11 @@
         total_lines++;
     }
     offset = eb_goto_pos(s->b, line_num, 0);
-    for(;x > 0; x--) {
+    for (; x > 0; x--) {
         c = eb_nextc(s->b, offset, &offset1);
         if (c == '\n') {
             buf1[0] = ' ';
-            for(;x > 0; x--) {
+            for (; x > 0; x--) {
                 eb_insert(s->b, offset, buf1, 1);
             }
             break;
@@ -388,7 +388,7 @@
 void tty_csi_m(ShellState *s, int c)
 {
     /* we handle only a few possible modes */
-    switch(c) {
+    switch (c) {
     case 0:
         s->color = s->def_color;
         break;
@@ -413,7 +413,7 @@
     if (s->cur_offset == -1)
         return;
 
-    for(e = qs->first_window; e != NULL; e = e->next_window) {
+    for (e = qs->first_window; e != NULL; e = e->next_window) {
         if (s->b == e->b && e->interactive) {
             e->offset = s->cur_offset;
         }
@@ -720,7 +720,7 @@
                 break;
             case 'K':   /* clear eol (parm=1 -> bol) */
                 offset1 = s->cur_offset;
-                for(;;) {
+                for (;;) {
                     c = eb_nextc(s->b, offset1, &offset2);
                     if (c == '\n')
                         break;
@@ -734,7 +734,7 @@
                 if (n <= 0)
                     n = 1;
                 offset1 = s->cur_offset;
-                for(;n > 0;n--) {
+                for (; n > 0; n--) {
                     c = eb_nextc(s->b, offset1, &offset2);
                     if (c == '\n')
                         break;
@@ -748,7 +748,7 @@
                 if (n <= 0)
                     n = 1;
                 buf1[0] = ' ';
-                for(;n > 0;n--) {
+                for (; n > 0; n--) {
                     eb_insert(s->b, s->cur_offset, buf1, 1);
                 }
                 break;
@@ -757,7 +757,7 @@
                 n = s->nb_esc_params;
                 if (n == 0)
                     n = 1;
-                for(i=0;i<n;i++)
+                for (i = 0; i < n; i++)
                     tty_csi_m(s, s->esc_params[i]);
                 break;
             case 'n':
@@ -791,7 +791,7 @@
     unsigned char buf[32];
     int len;
 
-    switch(op) {
+    switch (op) {
     case LOGOP_WRITE:
         while (size > 0) {
             len = size;
@@ -835,7 +835,7 @@
     /* record line */
     buf_ptr = buf;
     buf_end = buf + buf_size;
-    for(;;) {
+    for (;;) {
         eb_read(b_color, offset, buf1, 1);
         color = buf1[0];
         c = eb_nextc(b, offset, &offset1);
@@ -1118,7 +1118,7 @@
         ch = c;
         tty_write(s, &ch, 1);
     } else {
-        switch(c) {
+        switch (c) {
         case 4:
             do_delete_char(e);
             break;
@@ -1157,9 +1157,10 @@
 #endif
 }
 
+/* CG: these variables should move to mode structure */
 static int error_offset = -1;
 static int last_line_num = -1;
-static char last_filename[1024];
+static char last_filename[MAX_FILENAME_SIZE];
 
 static void do_compile(EditState *e, const char *cmd)
 {
@@ -1196,7 +1197,7 @@
     EditState *e;
     EditBuffer *b;
     int offset, offset1, found_offset;
-    char filename[1024], *q;
+    char filename[MAX_FILENAME_SIZE], *q;
     int line_num, c;
 
     /* CG: should have a buffer flag for error source.
@@ -1217,13 +1218,13 @@
         offset = 0;
         goto find_error;
     }
-    for(;;) {
+    for (;;) {
         if (dir > 0) {
             if (offset >= b->total_size) {
                 put_status(s, "No more errors");
                 return;
             }
-            for(;;) {
+            for (;;) {
                 c = eb_nextc(b, offset, &offset);
                 if (c == '\n')
                     break;
@@ -1234,7 +1235,7 @@
                 return;
             }
             eb_prevc(b, offset, &offset);
-            for(;;) {
+            for (;;) {
                 c = eb_prevc(b, offset, &offset1);
                 if (c == '\n')
                     break;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]