]> sourceware.org Git - annobin.git/commitdiff
Handle the case where source input is from a pipe
authorNick Clifton <nickc@redhat.com>
Fri, 8 Dec 2017 11:10:32 +0000 (11:10 +0000)
committerNick Clifton <nickc@redhat.com>
Fri, 8 Dec 2017 11:10:32 +0000 (11:10 +0000)
plugin/annobin.cc

index bb4282f04c0588be26fa02881abe86201dd59e6c..bb7c14f1773916c361efa6da8dc57e235302dfa5 100644 (file)
@@ -103,6 +103,14 @@ init_annobin_current_filename (void)
     return;
 
   name = (char *) lbasename (main_input_filename);
+
+  if (strlen (name) == 0)
+    {
+      /* The name can be empty if we are receiving the source code
+        from a pipe.  In this case, we invent our own name.  */
+      name = "piped_input";
+    }
+
   if (global_file_name_symbols)
     name = strcpy ((char *) xmalloc (strlen (name) + 20), name);
   else
This page took 0.027262 seconds and 5 git commands to generate.