]> git.ipfire.org Git - thirdparty/make.git/commitdiff
* job.c (child_error): Add filename length to output length.
authorPaul Smith <psmith@gnu.org>
Sat, 9 Apr 2016 13:25:50 +0000 (09:25 -0400)
committerPaul Smith <psmith@gnu.org>
Sat, 9 Apr 2016 13:25:50 +0000 (09:25 -0400)
Reported by Dale Stimson <dale@riyescott.com>

job.c

diff --git a/job.c b/job.c
index 62e2e56aeee0ba95005a648f02c3521f69774d9f..66dde71c6e3301d50c32c86e9e4dc23d8ab660c6 100644 (file)
--- a/job.c
+++ b/job.c
@@ -481,7 +481,7 @@ child_error (struct child *child,
   const struct file *f = child->file;
   const gmk_floc *flocp = &f->cmds->fileinfo;
   const char *nm;
-  size_t l = strlen (f->name);
+  size_t l;
 
   if (ignored && silent_flag)
     return;
@@ -504,9 +504,9 @@ child_error (struct child *child,
       nm = a;
     }
 
-  OUTPUT_SET (&child->output);
+  l = strlen (pre) + strlen (nm) + strlen (f->name) + strlen (post);
 
-  l += strlen (pre) + strlen (post);
+  OUTPUT_SET (&child->output);
 
   if (exit_sig == 0)
     error (NILF, l + INTSTR_LENGTH,