804b7cadbdd8c9bbc34d5da014d4b868f781317a max Mon Apr 4 13:58:43 2016 -0700 more comments after email from chris diff --git src/lib/obscure.c src/lib/obscure.c index 5208b76..4b1d190 100644 --- src/lib/obscure.c +++ src/lib/obscure.c @@ -448,31 +448,31 @@ } hashAdd(hash, var, cloneString(val)); } freez(&dupe); return hash; } struct hash *hashVarLine(char *line, int lineIx) /* Return a symbol table from a line of form: * var1=val1 var2='quoted val2' var3="another val" */ { return hashThisEqThatLine(line, lineIx, TRUE); } struct slName *stringToSlNames(char *string) -/* Convert string to a list of slNames separated by +/* split string and convert to a list of slNames separated by * white space, but allowing multiple words in quotes. * Quotes if any are stripped. */ { struct slName *list = NULL, *name; char *dupe = cloneString(string); char c, *s = dupe, *e; for (;;) { if ((s = skipLeadingSpaces(s)) == NULL) break; if ((c = *s) == 0) break; if (c == '\'' || c == '"') { @@ -482,61 +482,61 @@ else { e = skipToSpaces(s); if (e != NULL) *e++ = 0; } name = slNameNew(s); slAddHead(&list, name); s = e; } freeMem(dupe); slReverse(&list); return list; } struct slName *charSepToSlNames(char *string, char c) -/* Convert character-separated list of items to slName list. +/* Split string and convert character-separated list of items to slName list. * Note that the last occurence of c is optional. (That * is for a comma-separated list a,b,c and a,b,c, are * equivalent. */ { struct slName *list = NULL, *el; char *s, *e; s = string; while (s != NULL && s[0] != 0) { e = strchr(s, c); if (e == NULL) { el = slNameNew(s); slAddHead(&list, el); break; } else { el = slNameNewN(s, e - s); slAddHead(&list, el); s = e+1; } } slReverse(&list); return list; } struct slName *commaSepToSlNames(char *commaSep) -/* Convert comma-separated list of items to slName list. */ +/* Split string and convert comma-separated list of items to slName list. */ { return charSepToSlNames(commaSep, ','); } void sprintLongWithCommas(char *s, long long l) /* Print out a long number with commas a thousands, millions, etc. */ { long long trillions, billions, millions, thousands; if (l >= 1000000000000LL) { trillions = l/1000000000000LL; l -= trillions * 1000000000000LL; billions = l/1000000000; l -= billions * 1000000000;