- while (fgets(line, sizeof(line), projects) != NULL) {
- for (z = &lastc(line);
- strlen(line) && strchr("\n\r", *z);
- z = &lastc(line))
- *z = '\0';
- if (strlen(line))
- scan_path(path, fmt("%s/%s", path, line), fn);
+ while (strbuf_getline(&line, projects, '\n') != EOF) {
+ if (!line.len)
+ continue;
+ strbuf_insert(&line, 0, "/", 1);
+ strbuf_insert(&line, 0, path, strlen(path));
+ scan_path(path, line.buf, fn);