diff options
author | Neil Booth <neil@daikokuya.co.uk> | 2003-03-17 06:39:37 +0000 |
---|---|---|
committer | Neil Booth <neil@gcc.gnu.org> | 2003-03-17 06:39:37 +0000 |
commit | 72ecfc6033acf7c9294f27fe66d2c8886f1dc86d (patch) | |
tree | d1d9366cdbc9a372e429619869f35de3911c58ce /gcc/fix-header.c | |
parent | 47009d11db95bf3bf3933a00d0957006827eca3d (diff) | |
download | gcc-72ecfc6033acf7c9294f27fe66d2c8886f1dc86d.zip gcc-72ecfc6033acf7c9294f27fe66d2c8886f1dc86d.tar.gz gcc-72ecfc6033acf7c9294f27fe66d2c8886f1dc86d.tar.bz2 |
* fix-header.c (read_scan_file): Need to malloc arguments to add_path.
From-SVN: r64470
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 f58df6e..8434cce 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]); } } |