]> git.ipfire.org Git - thirdparty/make.git/commitdiff
Remove extraneous characters from fatal() calls
authorPaul Smith <psmith@gnu.org>
Sat, 26 Feb 2022 23:30:00 +0000 (18:30 -0500)
committerPaul Smith <psmith@gnu.org>
Sun, 27 Feb 2022 23:01:13 +0000 (18:01 -0500)
The fatal() method adds ".  Stop.\n" to every message.

* src/amiga.c (MyExecute): Remove newline from fatal() message.
* src/job.c (<various>): Ditto.
* src/file.c (snap_deps): Remove "." from fatal() message.
* src/main.c (main): Ditto.
* src/load.c: Ditto.
* tests/scripts/targets/NOTINTERMEDIATE: Fix expected output.

src/amiga.c
src/file.c
src/job.c
src/load.c
src/main.c
tests/scripts/targets/NOTINTERMEDIATE

index 9f9b546aedb111fffc8fb3dbc5881867ad73fa28..ec0ca14320b9da670599e02bab3c20c9aea71c68 100644 (file)
@@ -42,7 +42,7 @@ MyExecute (char **argv)
     buffer = AllocMem (len, MEMF_ANY);
 
     if (!buffer)
-      O (fatal, NILF, "MyExecute: Cannot allocate space for calling a command\n");
+      O (fatal, NILF, "MyExecute: Cannot allocate space for calling a command");
 
     ptr = buffer;
 
index f9ef596c4ed83e10d86218ed21ab65b7531c3c6f..2afad87267b5447b3a83b9b8d257e4eda997134b 100644 (file)
@@ -816,7 +816,7 @@ snap_deps (void)
       for (f2 = d->file; f2 != 0; f2 = f2->prev)
         if (f2->notintermediate)
           OS (fatal, NILF,
-              _("%s cannot be both .NOTINTERMEDIATE and .INTERMEDIATE."),
+              _("%s cannot be both .NOTINTERMEDIATE and .INTERMEDIATE"),
               f2->name);
         else
           f2->intermediate = 1;
@@ -831,7 +831,7 @@ snap_deps (void)
         for (f2 = d->file; f2 != 0; f2 = f2->prev)
         if (f2->notintermediate)
           OS (fatal, NILF,
-              _("%s cannot be both .NOTINTERMEDIATE and .SECONDARY."),
+              _("%s cannot be both .NOTINTERMEDIATE and .SECONDARY"),
               f2->name);
         else
           f2->intermediate = f2->secondary = 1;
index 052934f78d0a43ee5d5aa1009675802b7c748249..8d1bdefb2b7bab7bc73b5cde41f9a819ec4b29ad 100644 (file)
--- a/src/job.c
+++ b/src/job.c
@@ -367,7 +367,7 @@ create_batch_file (char const *base, int unixy, int *fd)
 
   *fd = -1;
   if (error_string == NULL)
-    error_string = _("Cannot create a temporary file\n");
+    error_string = _("Cannot create a temporary file");
   O (fatal, NILF, error_string);
 
   /* not reached */
@@ -1109,7 +1109,7 @@ free_child (struct child *child)
   output_close (&child->output);
 
   if (!jobserver_tokens)
-    ONS (fatal, NILF, "INTERNAL: Freeing child %p (%s) but no tokens left!\n",
+    ONS (fatal, NILF, "INTERNAL: Freeing child %p (%s) but no tokens left",
          child, child->file->name);
 
   /* If we're using the jobserver and this child is not the only outstanding
@@ -1865,7 +1865,7 @@ new_job (struct file *file)
         /* There must be at least one child already, or we have no business
            waiting for a token. */
         if (!children)
-          O (fatal, NILF, "INTERNAL: no children as we go to sleep on read\n");
+          O (fatal, NILF, "INTERNAL: no children as we go to sleep on read");
 
         /* Get a token.  */
         got_token = jobserver_acquire (waiting_jobs != NULL);
@@ -2186,7 +2186,7 @@ child_execute_job (struct childbase *child, int good_stdin, char **argv)
     {
       save_fdin = dup (FD_STDIN);
       if (save_fdin < 0)
-        O (fatal, NILF, _("no more file handles: could not duplicate stdin\n"));
+        O (fatal, NILF, _("no more file handles: could not duplicate stdin"));
       fd_noinherit (save_fdin);
 
       dup2 (fdin, FD_STDIN);
@@ -2198,7 +2198,7 @@ child_execute_job (struct childbase *child, int good_stdin, char **argv)
       save_fdout = dup (FD_STDOUT);
       if (save_fdout < 0)
         O (fatal, NILF,
-           _("no more file handles: could not duplicate stdout\n"));
+           _("no more file handles: could not duplicate stdout"));
       fd_noinherit (save_fdout);
 
       dup2 (fdout, FD_STDOUT);
@@ -2212,7 +2212,7 @@ child_execute_job (struct childbase *child, int good_stdin, char **argv)
           save_fderr = dup (FD_STDERR);
           if (save_fderr < 0)
             O (fatal, NILF,
-               _("no more file handles: could not duplicate stderr\n"));
+               _("no more file handles: could not duplicate stderr"));
           fd_noinherit (save_fderr);
         }
 
@@ -2227,7 +2227,7 @@ child_execute_job (struct childbase *child, int good_stdin, char **argv)
   if (save_fdin >= 0)
     {
       if (dup2 (save_fdin, FD_STDIN) != FD_STDIN)
-        O (fatal, NILF, _("Could not restore stdin\n"));
+        O (fatal, NILF, _("Could not restore stdin"));
       else
         close (save_fdin);
     }
@@ -2235,7 +2235,7 @@ child_execute_job (struct childbase *child, int good_stdin, char **argv)
   if (save_fdout >= 0)
     {
       if (dup2 (save_fdout, FD_STDOUT) != FD_STDOUT)
-        O (fatal, NILF, _("Could not restore stdout\n"));
+        O (fatal, NILF, _("Could not restore stdout"));
       else
         close (save_fdout);
     }
@@ -2243,7 +2243,7 @@ child_execute_job (struct childbase *child, int good_stdin, char **argv)
   if (save_fderr >= 0)
     {
       if (dup2 (save_fderr, FD_STDERR) != FD_STDERR)
-        O (fatal, NILF, _("Could not restore stderr\n"));
+        O (fatal, NILF, _("Could not restore stderr"));
       else
         close (save_fderr);
     }
index e4f551a30a821ea23d8d8a4cf1490ab8a1fd033a..f86027d3e26f2b2e9cb1cda1e57231d296251a9d 100644 (file)
@@ -253,7 +253,7 @@ load_file (const floc *flocp, const char **ldname UNUSED, int noerror)
 {
   if (! noerror)
     O (fatal, flocp,
-       _("The 'load' operation is not supported on this platform."));
+       _("The 'load' operation is not supported on this platform"));
 
   return 0;
 }
@@ -261,7 +261,7 @@ load_file (const floc *flocp, const char **ldname UNUSED, int noerror)
 void
 unload_file (const char *name UNUSED)
 {
-  O (fatal, NILF, "INTERNAL: Cannot unload when load is not supported!");
+  O (fatal, NILF, "INTERNAL: Cannot unload when load is not supported");
 }
 
 #endif  /* MAKE_LOAD */
index 800591107f01eb62adca576d96527224495ec531..be0c87418b280763e6473f2cf0727d18e136420c 100644 (file)
@@ -1789,7 +1789,7 @@ main (int argc, char **argv, char **envp)
 
             if (stdin_nm)
               O (fatal, NILF,
-                 _("Makefile from standard input specified twice."));
+                 _("Makefile from standard input specified twice"));
 
 #ifdef VMS
 # define DEFAULT_TMPDIR     "/sys$scratch/"
@@ -2465,7 +2465,7 @@ main (int argc, char **argv, char **envp)
                 }
               if (bad)
                 O (fatal, NILF,
-                   _("Couldn't change back to original directory."));
+                   _("Couldn't change back to original directory"));
             }
 
           ++restarts;
index bf4cb52e2e7723d531d15ad0bedbabf524af20e8..e4690b128035021db3b5e30ec57d717b762fad95 100644 (file)
@@ -48,13 +48,13 @@ hello.z:
 run_make_test(q!
 .INTERMEDIATE: hello.x
 .NOTINTERMEDIATE: hello.x
-!, '', "#MAKE#: *** hello.x cannot be both .NOTINTERMEDIATE and .INTERMEDIATE..  Stop.\n", 512);
+!, '', "#MAKE#: *** hello.x cannot be both .NOTINTERMEDIATE and .INTERMEDIATE.  Stop.\n", 512);
 
 # Test 6. Same file cannot be secondary and notintermediate.
 run_make_test(q!
 .SECONDARY: hello.x
 .NOTINTERMEDIATE: hello.x
-!, '', "#MAKE#: *** hello.x cannot be both .NOTINTERMEDIATE and .SECONDARY..  Stop.\n", 512);
+!, '', "#MAKE#: *** hello.x cannot be both .NOTINTERMEDIATE and .SECONDARY.  Stop.\n", 512);
 
 # Test 7. All .SECONDARY and all .NOTINTERMEDIATE are mutually exclusive.
 run_make_test(q!