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

Diff for /src/usr.bin/sort/bwstring.c between version 1.2 and 1.3

version 1.2, 2015/03/18 22:39:41 version 1.3, 2015/03/18 22:53:27
Line 69 
Line 69 
                                 tmp = nl_langinfo(item[i]);                                  tmp = nl_langinfo(item[i]);
                                 if (debug_sort)                                  if (debug_sort)
                                         printf("month[%d]=%s\n", i, tmp);                                          printf("month[%d]=%s\n", i, tmp);
                                 len = strlen(tmp);                                  if (*tmp == '\0')
                                 if (len < 1)  
                                         continue;                                          continue;
                                 while (isblank((unsigned char)*tmp))                                  m = sort_strdup(tmp);
                                         ++tmp;  
                                 m = sort_malloc(len + 1);  
                                 memcpy(m, tmp, len + 1);  
                                 m[len] = '\0';  
                                 for (j = 0; j < len; j++)                                  for (j = 0; j < len; j++)
                                         m[j] = toupper(m[j]);                                          m[j] = toupper(m[j]);
                                 cmonths[i] = m;                                  cmonths[i] = m;
Line 94 
Line 89 
                                 tmp = nl_langinfo(item[i]);                                  tmp = nl_langinfo(item[i]);
                                 if (debug_sort)                                  if (debug_sort)
                                         printf("month[%d]=%s\n", i, tmp);                                          printf("month[%d]=%s\n", i, tmp);
                                 len = strlen(tmp);                                  if (*tmp == '\0')
                                 if (len < 1)  
                                         continue;                                          continue;
                                 while (isblank((unsigned char)*tmp))                                  len = strlen(tmp);
                                         ++tmp;  
                                 m = sort_malloc(SIZEOF_WCHAR_STRING(len + 1));                                  m = sort_malloc(SIZEOF_WCHAR_STRING(len + 1));
                                 if (mbstowcs(m, tmp, len) == (size_t)-1)                                  if (mbstowcs(m, tmp, len) == (size_t)-1) {
                                           sort_free(m);
                                         continue;                                          continue;
                                   }
                                 m[len] = L'\0';                                  m[len] = L'\0';
                                 for (j = 0; j < len; j++)                                  for (j = 0; j < len; j++)
                                         m[j] = towupper(m[j]);                                          m[j] = towupper(m[j]);

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3