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

Diff for /src/usr.bin/file/file.c between version 1.22 and 1.23

version 1.22, 2009/10/27 23:59:37 version 1.23, 2011/04/15 16:05:34
Line 424 
Line 424 
         wchar_t nextchar;          wchar_t nextchar;
         (void)memset(&state, 0, sizeof(mbstate_t));          (void)memset(&state, 0, sizeof(mbstate_t));
         old_n = n = strlen(s);          old_n = n = strlen(s);
           int w;
   
         while (n > 0) {          while (n > 0) {
                 bytesconsumed = mbrtowc(&nextchar, s, n, &state);                  bytesconsumed = mbrtowc(&nextchar, s, n, &state);
Line 438 
Line 439 
                          * is always right                           * is always right
                          */                           */
                         width++;                          width++;
                 } else                  } else {
                         width += wcwidth(nextchar);                          w = wcwidth(nextchar);
                           if (w > 0)
                                   width += w;
                   }
   
                 s += bytesconsumed, n -= bytesconsumed;                  s += bytesconsumed, n -= bytesconsumed;
         }          }

Legend:
Removed from v.1.22  
changed lines
  Added in v.1.23