aboutsummaryrefslogtreecommitdiff
path: root/gcc/toplev.c
diff options
context:
space:
mode:
authorAndrew Haley <aph@redhat.com>2003-10-23 14:18:14 +0000
committerAndrew Haley <aph@gcc.gnu.org>2003-10-23 14:18:14 +0000
commit00503146990fe82f1a2fcb4ee5daee776b27e882 (patch)
tree063b2c2516ad462476e556041f1f560c889c3b8b /gcc/toplev.c
parent9d7d51be97bd43c0ecb60ca327c44f1fd9272224 (diff)
downloadgcc-00503146990fe82f1a2fcb4ee5daee776b27e882.zip
gcc-00503146990fe82f1a2fcb4ee5daee776b27e882.tar.gz
gcc-00503146990fe82f1a2fcb4ee5daee776b27e882.tar.bz2
toplev.c (output_file_directive): Allow for null input_name.
2003-10-22 Andrew Haley <aph@redhat.com> * toplev.c (output_file_directive): Allow for null input_name. From-SVN: r72847
Diffstat (limited to 'gcc/toplev.c')
-rw-r--r--gcc/toplev.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/gcc/toplev.c b/gcc/toplev.c
index 219c699..41b27ed 100644
--- a/gcc/toplev.c
+++ b/gcc/toplev.c
@@ -1444,8 +1444,14 @@ output_quoted_string (FILE *asm_file, const char *string)
void
output_file_directive (FILE *asm_file, const char *input_name)
{
- int len = strlen (input_name);
- const char *na = input_name + len;
+ int len;
+ const char *na;
+
+ if (input_name == NULL)
+ input_name = "<stdin>";
+
+ len = strlen (input_name);
+ na = input_name + len;
/* NA gets INPUT_NAME sans directory names. */
while (na > input_name)