diff -bru findutils-4.1.7/locate/frcode.c findutils-4.1.7-new/locate/frcode.c --- findutils-4.1.7/locate/frcode.c Wed Apr 12 11:43:28 2000 +++ findutils-4.1.7-new/locate/frcode.c Tue Jul 3 22:30:09 2001 @@ -21,8 +21,6 @@ see ";login:", March 1983, p. 8. The input is a sorted list of NUL-terminated strings. - (FIXME newline-terminated, until we figure out how to sort - NUL-terminated strings.) The output entries are in the same order as the input; each entry consists of an offset-differential count byte @@ -126,12 +124,8 @@ fwrite (LOCATEDB_MAGIC, sizeof (LOCATEDB_MAGIC), 1, stdout); - /* FIXME temporary: change the \n to \0 when we figure out how to sort - null-terminated strings. */ - while ((line_len = getline (&path, &pathsize, stdin)) > 0) + while ((line_len = getdelim (&path, &pathsize, '\0', stdin)) > 0) { - path[line_len - 1] = '\0'; /* FIXME temporary: nuke the newline. */ - count = prefix_length (oldpath, path); diffcount = count - oldcount; oldcount = count; diff -bru findutils-4.1.7/locate/updatedb.sh findutils-4.1.7-new/locate/updatedb.sh --- findutils-4.1.7/locate/updatedb.sh Sun May 20 22:39:37 2001 +++ findutils-4.1.7-new/locate/updatedb.sh Tue Jul 3 22:38:05 2001 @@ -112,30 +112,29 @@ if test $old = no; then -# FIXME figure out how to sort null-terminated strings, and use -print0. { if test -n "$SEARCHPATHS"; then if [ "$LOCALUSER" != "" ]; then su $LOCALUSER -c \ "$find $SEARCHPATHS \ \\( $prunefs_exp \ - -type d -regex '$PRUNEREGEX' \\) -prune -o -print" + -type d -regex '$PRUNEREGEX' \\) -prune -o -print0" else $find $SEARCHPATHS \ \( $prunefs_exp \ - -type d -regex "$PRUNEREGEX" \) -prune -o -print + -type d -regex "$PRUNEREGEX" \) -prune -o -print0 fi fi if test -n "$NETPATHS"; then if [ "`whoami`" = root ]; then su $NETUSER -c \ - "$find $NETPATHS \\( -type d -regex '$PRUNEREGEX' -prune \\) -o -print" + "$find $NETPATHS \\( -type d -regex '$PRUNEREGEX' -prune \\) -o -print0" else - $find $NETPATHS \( -type d -regex "$PRUNEREGEX" -prune \) -o -print + $find $NETPATHS \( -type d -regex "$PRUNEREGEX" -prune \) -o -print0 fi fi -} | sort -f | $frcode > $LOCATE_DB.n +} | sort -f -z | $frcode > $LOCATE_DB.n # To avoid breaking locate while this script is running, put the # results in a temp file, then rename it atomically.