[BACK]Return to util.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / mg

Diff for /src/usr.bin/mg/util.c between version 1.8 and 1.9

version 1.8, 2002/05/30 16:07:57 version 1.9, 2003/05/16 19:28:59
Line 8 
Line 8 
  */   */
   
 #include "def.h"  #include "def.h"
   #include <ctype.h>
   
 /*  /*
  * Display a bunch of useful information about the current location of dot.   * Display a bunch of useful information about the current location of dot.
Line 71 
Line 72 
 }  }
   
 int  int
 getcolpos()  getcolpos(void)
 {  {
         int     col, i, c;          int     col, i, c;
   
         /* determine column */          /* determine column */
         col = 1;          col = 0;
   
         for (i = 0; i < curwp->w_doto; ++i) {          for (i = 0; i < curwp->w_doto; ++i) {
                 c = lgetc(curwp->w_dotp, i);                  c = lgetc(curwp->w_dotp, i);
Line 86 
Line 87 
 #endif /* NOTAB */  #endif /* NOTAB */
                         ) {                          ) {
                         col |= 0x07;                          col |= 0x07;
                         ++col;                          col++;
                 } else if (ISCTRL(c) != FALSE)                  } else if (ISCTRL(c) != FALSE)
                         ++col;                          col += 2;
                 ++col;                  else if (isprint(c))
                           col++;
                   else {
                           char tmp[5];
                           snprintf(tmp, sizeof tmp, "\\%o", c);
                           col += strlen(tmp);
                   }
   
         }          }
         return col;          return col;
 }  }

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.9