Initial import
[fw/sdcc] / src / SDCCmain.c
index ea98540c91ec5e9b1679a82fa83e7c1f1161c4e5..6ac338a433de2db8aebda684befc647847371f41 100644 (file)
@@ -485,11 +485,17 @@ void
 setParseWithComma (set **dest, char *src)
 {
   char *p;
+  int length;
 
   /* skip the initial white spaces */
   while (isspace(*src))
     src++;
 
+  /* skip the trailing white spaces */
+  length = strlen(src);
+  while (length && isspace(src[length-1]))
+    src[--length] = '\0';
+
   for (p = strtok(src, ","); p != NULL; p = strtok(NULL, ","))
     addSet(dest, Safe_strdup(p));
 }