continue;
/* Split the line by whitespace and build the languages list. */
- start = line_buf;
- while (*start != '\0')
+ for (start = line_buf; start - line_buf < len; )
{
- char *end = start;
- int c;
+ char *p;
- while (*end != '\0' && *end != ' ' && *end != '\t')
- end++;
-
- c = *end;
- *end = '\0';
- string_list_append_unique (languages, start);
-
- if (c == '\0')
- break;
-
- start = end + 1;
+ /* Skip whitespace before the string. */
while (*start == ' ' || *start == '\t')
start++;
+
+ p = start;
+ while (*p != ' ' && *p != '\t')
+ p++;
+
+ *p = '\0';
+ string_list_append_unique (languages, start);
+ start = p + 1;
}
}