Index: src/checkin.c ================================================================== --- src/checkin.c +++ src/checkin.c @@ -675,25 +675,30 @@ ** --age Show when each file was committed. ** -v|--verbose Provide extra information about each file. ** -t Sort output in time order. ** -r VERSION The specific check-in to list. ** -R|--repository FILE Extract info from repository FILE. +** -0 Use NULL instead of whitespace to separate +** filenames ** ** See also: changes, extras, status */ void ls_cmd(void){ int vid; Stmt q; int verboseFlag; + int nullSeparateFlag; + char separator = '\n'; int showAge; int timeOrder; char *zOrderBy = "pathname"; Blob where; int i; const char *zName; const char *zRev; + nullSeparateFlag = find_option("0", "0", 0)!=0; verboseFlag = find_option("verbose","v", 0)!=0; if( !verboseFlag ){ verboseFlag = find_option("l","l", 0)!=0; /* deprecated */ } showAge = find_option("age",0,0)!=0; @@ -792,14 +797,16 @@ type = "RENAMED "; }else{ type = "UNCHANGED "; } } + if (nullSeparateFlag) + separator='\0'; if( showAge ){ - fossil_print("%s%s %s\n", type, db_column_text(&q, 5), zPathname); + fossil_print("%s%s %s%c", type, db_column_text(&q, 5), zPathname, separator); }else{ - fossil_print("%s%s\n", type, zPathname); + fossil_print("%s%s%c", type, zPathname, separator); } free(zFullName); } db_finalize(&q); }