From: Thomas Walker Lynch Date: Mon, 1 Apr 2019 18:32:50 +0000 (+0200) Subject: trc checkpoint X-Git-Url: https://git.reasoningtechnology.com/style/static/git-logo.png?a=commitdiff_plain;h=7bf5d02abc44bb11196c7b18e9ef3604ad4a11de;p=subu trc checkpoint --- diff --git a/module/share/lib/libda.a b/module/share/lib/libda.a index 7e790c4..67e5e14 100644 Binary files a/module/share/lib/libda.a and b/module/share/lib/libda.a differ diff --git a/module/tranche/src/tranche.lib.c b/module/tranche/src/tranche.lib.c index 71f2e33..a039723 100644 --- a/module/tranche/src/tranche.lib.c +++ b/module/tranche/src/tranche.lib.c @@ -41,23 +41,27 @@ static char *is_tranche_end(char *pt){ return pt + tranche_end_tag_len; } -static void parse_file_list(Da *file_names, char *pt0, char *tdir){ +static void parse_file_list(Da *file_names, char *pt, char *tdir){ Da filename_arr; Da *fn_arrp = &filename_arr; da_alloc(fn_arrp,sizeof(char)); - while( *pt0 && isspace(*pt0) ) pt0++; - if(tdir){ - da_string_push(fn_arrp, tdir); - da_push(fn_arrp, &slash); - } - while( *pt0 && !isspace(*pt0) ){ - da_push(fn_arrp, *pt0); + while( *pt && isspace(*pt) ) pt++; + while( *pt ){ + if(tdir){ + da_string_push(fn_arrp, tdir); + da_push(fn_arrp, &slash); + } + while( *pt && !isspace(*pt) ){ + da_push(fn_arrp, pt); + pt += fn_arrp->element_size; + } + da_push(fn_arrp, &terminator); + char *file_name = strdup(fn_arrp->base); + da_rewind(fn_arrp); + da_push(file_names, &file_name); + while( *pt && isspace(*pt) ) pt++; } - da_push(fn_arrp, &terminator); - - char *file_name = strdup(*(char **)fn_arrp->base); - da_push(file_names, &file_name); } //-------------------------------------------------------------------------------- @@ -148,7 +152,7 @@ int tranche_target(FILE *src, Da *target_arrp, char *tdir){ parse_file_list(&file_name_arr, pt, tdir); da_strings_set_union(target_arrp, &file_name_arr, free); da_rewind(&file_name_arr); - tranche_target(src, target_arrp); + tranche_target(src, target_arrp, tdir); } da_rewind(&line); } @@ -179,7 +183,7 @@ void tranche_make(FILE *src_file, char *src_name, int mfile_fd, char *tdir){ Da ta; Da *tap=&ta; // target array pointer da_alloc(tap, sizeof(char *)); - tranche_target(src_file, tap); + tranche_target(src_file, tap, tdir); // construct then output the dependency line ---------------------------------------- Da dla; @@ -187,10 +191,6 @@ void tranche_make(FILE *src_file, char *src_name, int mfile_fd, char *tdir){ da_alloc(dlap, sizeof(char)); char *pt = tap->base; // char * because it points to a byte in the array while( pt < tap->end ){ - if(tdir){ - da_string_push(dlap, tdir); - da_push(dlap, &slash); - } da_string_push(dlap, *(char **)pt); da_push(dlap, &sp); pt += tap->element_size; diff --git a/module/tranche/test/try/test2.sh b/module/tranche/test/try/test2.sh index 5959bbc..c5617a8 100644 --- a/module/tranche/test/try/test2.sh +++ b/module/tranche/test/try/test2.sh @@ -3,6 +3,6 @@ diff -q test2.c test2.c.expected diff -q test2.h test2.h.expected diff -q test2stdout.dat test2stdout.dat.expected -rm test2.c test2.h test2stdout.dat.expected +rm test2.c test2.h test2stdout.dat diff --git a/module/tranche/test/try/test2stdout.dat b/module/tranche/test/try/test2stdout.dat deleted file mode 100644 index 139597f..0000000 --- a/module/tranche/test/try/test2stdout.dat +++ /dev/null @@ -1,2 +0,0 @@ - - diff --git a/module/tranche/test/try/test2stdout.dat.expected b/module/tranche/test/try/test2stdout.dat.expected new file mode 100644 index 0000000..139597f --- /dev/null +++ b/module/tranche/test/try/test2stdout.dat.expected @@ -0,0 +1,2 @@ + + diff --git a/module/tranche/test/try/test3.out.expected b/module/tranche/test/try/test3.out.expected index 8294b86..8bb7f8f 100644 --- a/module/tranche/test/try/test3.out.expected +++ b/module/tranche/test/try/test3.out.expected @@ -2,4 +2,4 @@ test11.dat test12.dat test13.dat test14.dat -test15.dat +test15.dat \ No newline at end of file diff --git a/module/tranche/test/try/test4.out.expected b/module/tranche/test/try/test4.out.expected index 05de4b1..e69de29 100644 --- a/module/tranche/test/try/test4.out.expected +++ b/module/tranche/test/try/test4.out.expected @@ -1,2 +0,0 @@ -test2.c -test2.h diff --git a/module/tranche/test/try/test5.sh b/module/tranche/test/try/test5.sh index 284d01e..b949f72 100644 --- a/module/tranche/test/try/test5.sh +++ b/module/tranche/test/try/test5.sh @@ -1,4 +1,4 @@ -./tranche test1.dat test2.trc.c +./tranche test1.dat test2.trc.c > /dev/null diff -q test11.dat test11.dat.expected diff -q test12.dat test12.dat.expected diff --git a/tool/bin/tranche b/tool/bin/tranche index 5489419..ad95624 100755 Binary files a/tool/bin/tranche and b/tool/bin/tranche differ diff --git a/tool/bin/tranche-make b/tool/bin/tranche-make index 6ec278f..79dd3aa 100755 Binary files a/tool/bin/tranche-make and b/tool/bin/tranche-make differ diff --git a/tool/bin/tranche-target b/tool/bin/tranche-target index e315a2c..a79e844 100755 Binary files a/tool/bin/tranche-target and b/tool/bin/tranche-target differ