b97ac00f262c24a3850888f0ecb557dd677b1fc4 tdreszer Fri Apr 1 09:31:15 2011 -0700 Bullet proof slNameListOfUniqueWords() fixing bug that Kate found. diff --git src/lib/common.c src/lib/common.c index d9799a7..ac59b99 100644 --- src/lib/common.c +++ src/lib/common.c @@ -750,39 +750,44 @@ slReverse(&list); return list; } struct slName *slNameListOfUniqueWords(char *text,boolean respectQuotes) // Return list of unique words found by parsing string delimited by whitespace. // If respectQuotes then ["Lucy and Ricky" 'Fred and Ethyl'] will yield 2 slNames no quotes { struct slName *list = NULL; char *word = NULL; while (text != NULL) { if (respectQuotes) { word = nextWordRespectingQuotes(&text); + if (word != NULL) + { if (word[0] == '"') stripChar(word, '"'); else if (word[0] == '\'') stripChar(word, '\''); } + } else word = nextWord(&text); if (word) slNameStore(&list, word); + else + break; } slReverse(&list); return list; } struct slName *slNameListFromStringArray(char *stringArray[], int arraySize) /* Return list of slNames from an array of strings of length arraySize. * If a string in the array is NULL, the array will be treated as * NULL-terminated (shorter than arraySize). */ { char *s; struct slName *list = NULL, *el; int i; if (stringArray == NULL)