11#include <ctype.h>
2- #include <stddef.h>
32#include <stdint.h>
43#include <stdio.h>
54#include <stdlib.h>
@@ -114,7 +113,6 @@ int parse_cache(FILE*handle,string_hashtable*table)
114113 push_vector_char (& depends ,& ch ,& ch + 1 );
115114 if (!isdependency )
116115 {
117- printf ("inserting file %s\n" ,file );
118116 fail = insert_string_hashtable (table ,file ,depends );
119117 file = stackbuf ;
120118 }
@@ -190,10 +188,8 @@ int cache_again(string_hashtable*c,const char*file,char*const*args)
190188 char * it = arr .str ;
191189 char * it2 = arr .str ;
192190 char space = 0 ;
193- fwrite (arr .str ,1 ,arr .len ,stdout );
194191 for (;it != last && * it != ':' ;++ it );
195192 for (++ it ;it != last && (* it == '\\' || isspace (* it ));++ it );
196- printf ("arr.len is %u, it has offset %zu\n" ,arr .len ,it - arr .str );
197193 for (;it != last ;++ it )
198194 {
199195 if (* it == '\\' || isspace (* it ))
@@ -210,8 +206,6 @@ int cache_again(string_hashtable*c,const char*file,char*const*args)
210206 }
211207 * it2 ++ = '\n' ;
212208 arr .len -= last - it2 ;
213- fwrite (arr .str ,1 ,arr .len ,stdout );
214- printf ("arr.len is %u\n" ,arr .len );
215209 char * new = strdup (file );
216210 if (new != NULL )
217211 {
@@ -432,7 +426,6 @@ int buildfile(string_hashtable*cache,char*filename,char*outfile,const cpbuild_op
432426 char * start = arr .str ;
433427 char * last = arr .str + arr .len ;
434428 char * it = arr .str ;
435- fwrite (start ,1 ,arr .len ,stdout );
436429 for (;!recompile && it != last ;++ it )
437430 {
438431 next = * it == '\n' ;
@@ -546,6 +539,10 @@ int fill_default_options(cpbuild_options_t*opt)
546539 else
547540 memcpy (opt -> compilerpp ,cpb_default_option_list + 3 ,4 );
548541 }
542+ if (opt -> cache != NULL && opt -> cache [0 ]== '\0' )
543+ {
544+ opt -> cache = "CProgramBuilder.cache" ;
545+ }
549546 opt -> parallel = opt -> parallel < 1 ?1 :opt -> parallel ;
550547 opt -> objdir = opt -> objdir == NULL ?"." :opt -> objdir ;
551548 return succ ;
0 commit comments