X-Git-Url: http://git.marmaro.de/?a=blobdiff_plain;f=uip%2Fflist.c;h=e3da709b322201ab9fa9757c53264a8821039a75;hb=a01a41d031c796b526329a4170eb23f0ac93b949;hp=758d308162fc5ecc229eabf2c9dbc099eb03ecac;hpb=008837e090c008e3afe7a9c8667070bafa091e62;p=mmh diff --git a/uip/flist.c b/uip/flist.c index 758d308..e3da709 100644 --- a/uip/flist.c +++ b/uip/flist.c @@ -12,8 +12,6 @@ * control laws. This software is made available AS IS, and Xerox Corporation * makes no warranty about the software, its performance or its conformity to * any specification. - * - * $Id$ */ #include @@ -114,7 +112,6 @@ int AddFolder(char *, int); void BuildFolderList(char *, int); void BuildFolderListRecurse(char *, struct stat *, int); void PrintFolders(void); -static int num_digits (int); void AllocFolders(struct Folder **, int *, int); int AssignPriority(char *); static void do_readonly_folders(void); @@ -233,7 +230,7 @@ main(int argc, char **argv) } if (*cp == '+' || *cp == '@') { foldersToDo[numfolders++] = - path (cp + 1, *cp == '+' ? TFOLDER : TSUBCWF); + pluspath (cp); } else foldersToDo[numfolders++] = cp; } @@ -277,7 +274,8 @@ main(int argc, char **argv) ScanFolders(); qsort(folders, nFolders, sizeof(struct Folder), (qsort_comp) CompareFolders); PrintFolders(); - return done (0); + done (0); + return 1; } /* @@ -288,7 +286,7 @@ main(int argc, char **argv) void GetFolderOrder(void) { - char *p, *s; + unsigned char *p, *s; int priority = 1; struct Folder *o; @@ -400,7 +398,8 @@ BuildFolderList(char *dirName, int searchdepth) void BuildFolderListRecurse(char *dirName, struct stat *s, int searchdepth) { - char *base, *n, name[PATH_MAX]; + char *base, name[PATH_MAX]; + unsigned char *n; int nlinks; DIR *dir; struct dirent *dp; @@ -605,29 +604,6 @@ PrintFolders(void) } /* - * Calculate the number of digits in a nonnegative integer - */ -static int -num_digits (int n) -{ - int ndigits = 0; - - /* Sanity check */ - if (n < 0) - adios (NULL, "oops, num_digits called with negative value"); - - if (n == 0) - return 1; - - while (n) { - n /= 10; - ndigits++; - } - - return ndigits; -} - -/* * Put them in priority order. */