diff -up cscope-15.6/src/build.c.orig cscope-15.6/src/build.c --- cscope-15.6/src/build.c.orig 2006-09-30 04:13:00.000000000 -0400 +++ cscope-15.6/src/build.c 2008-07-08 11:28:53.000000000 -0400 @@ -124,7 +124,7 @@ samelist(FILE *oldrefs, char **names, in } /* see if the name list is the same */ for (i = 0; i < count; ++i) { - if (! fgets(oldname, sizeof(oldname), oldrefs)|| + if ((1 != fscanf(oldrefs," %[^\n]",oldname)) || strnotequal(oldname, names[i])) { return(NO); } @@ -305,10 +305,11 @@ cscope: -q option mismatch between comma /* see if the list of source files is the same and none have been changed up to the included files */ for (i = 0; i < nsrcfiles; ++i) { - if (! fgets(oldname, sizeof(oldname), oldrefs) || - strnotequal(oldname, srcfiles[i]) || - lstat(srcfiles[i], &statstruct) != 0 || - statstruct.st_mtime > reftime) { + if ((1 != fscanf(oldrefs," %[^\n]",oldname)) + || strnotequal(oldname, srcfiles[i]) + || (lstat(srcfiles[i], &statstruct) != 0) + || (statstruct.st_mtime > reftime) + ) { goto outofdate; } } @@ -338,8 +339,9 @@ cscope: converting to new symbol databas scanpast('\t'); /* skip the header */ oldfile = getoldfile(); } else { /* force cross-referencing of all the source files */ - force: reftime = 0; - oldfile = NULL; + force: + reftime = 0; + oldfile = NULL; } /* open the new cross-reference file */ if ((newrefs = myfopen(newreffile, "wb")) == NULL) {