Support for larger comments and keeping the tempfile around

This commit is contained in:
Jeremiah Orians 2022-01-20 07:58:03 -05:00
parent 533aeb1dfa
commit 477b517f26
No known key found for this signature in database
GPG Key ID: 6B3A3F198708F894
1 changed files with 8 additions and 2 deletions

10
cc.c
View File

@ -36,7 +36,7 @@ void spawn_processes(int debug_flag, char* preprocessed_file, char* destination,
int main(int argc, char** argv, char** envp) int main(int argc, char** argv, char** envp)
{ {
FUZZING = FALSE; FUZZING = FALSE;
MAX_STRING = 4096; MAX_STRING = 65536;
PREPROCESSOR_MODE = FALSE; PREPROCESSOR_MODE = FALSE;
STDIO_USED = FALSE; STDIO_USED = FALSE;
int debug_flag = TRUE; int debug_flag = TRUE;
@ -48,6 +48,7 @@ int main(int argc, char** argv, char** envp)
char* name; char* name;
char* hold; char* hold;
int DUMP_MODE = FALSE; int DUMP_MODE = FALSE;
int DIRTY_MODE = FALSE;
int i = 1; int i = 1;
while(i <= argc) while(i <= argc)
@ -66,6 +67,11 @@ int main(int argc, char** argv, char** envp)
DUMP_MODE = TRUE; DUMP_MODE = TRUE;
i+= 1; i+= 1;
} }
else if(match(argv[i], "--dirty-mode"))
{
DIRTY_MODE = TRUE;
i+= 1;
}
else if(match(argv[i], "-f") || match(argv[i], "--file")) else if(match(argv[i], "-f") || match(argv[i], "--file"))
{ {
if(NULL == hold_string) if(NULL == hold_string)
@ -198,7 +204,7 @@ int main(int argc, char** argv, char** envp)
spawn_processes(debug_flag, name, destination_name, envp); spawn_processes(debug_flag, name, destination_name, envp);
/* And clean up the donkey */ /* And clean up the donkey */
remove(name); if(!DIRTY_MODE) remove(name);
} }
else else
{ {