diff options
author | neil <neil@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-03-17 06:39:37 +0000 |
---|---|---|
committer | neil <neil@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-03-17 06:39:37 +0000 |
commit | 3289939f014324197752d67b58e7c2bf0711b8bd (patch) | |
tree | d1d9366cdbc9a372e429619869f35de3911c58ce /gcc/fix-header.c | |
parent | 0f51462db019a33a7a5dae473223aa89e4f8dd1c (diff) | |
download | gcc-3289939f014324197752d67b58e7c2bf0711b8bd.tar.gz |
* fix-header.c (read_scan_file): Need to malloc arguments to add_path.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@64470 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fix-header.c')
-rw-r--r-- | gcc/fix-header.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/gcc/fix-header.c b/gcc/fix-header.c index f58df6e7f75..8434ccee657 100644 --- a/gcc/fix-header.c +++ b/gcc/fix-header.c @@ -643,19 +643,21 @@ read_scan_file (in_fname, argc, argv) if (argv[i][1] == 'I') { if (argv[i][2] != '\0') - strings_processed = 1, add_path (argv[i] + 2, BRACKET, false); - else if (i + 1 == argc) - strings_processed = 0; - else - strings_processed = 2, add_path (argv[i + 1], BRACKET, false); + { + strings_processed = 1; + add_path (xstrdup (argv[i] + 2), BRACKET, false); + } + else if (i + 1 != argc) + { + strings_processed = 2; + add_path (xstrdup (argv[i + 1]), BRACKET, false); + } } else if (argv[i][1] == 'D') { if (argv[i][2] != '\0') strings_processed = 1, cpp_define (scan_in, argv[i] + 2); - else if (i + 1 == argc) - strings_processed = 0; - else + else if (i + 1 != argc) strings_processed = 2, cpp_define (scan_in, argv[i + 1]); } } |