🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.utils.bug
Article #641

Re: `canned' command sequences no longer work in gmake-3.62

#641
From: J.T. Conklin
Date: Wed, 26 Aug 1992 07:15
75 lines
2433 bytes
Earlier today, I sent a bug report about `canned' command sequences
(defined with "define ... endef") not working with gmake-3.62.

I copied the code from gmake-3.60, into the appropriate place in
construct_command_line_internal() and everything works as before.

Patch follows:

*** ../make-3.62/job.c	Thu Oct 24 14:58:33 1991
--- job.c	Wed Aug 26 13:52:43 1992
***************
*** 586,593 ****
      /* Still executing the last line we started.  */
      recursive = child->file->cmds->lines_recurse[child->command_line - 1];

-   /* Find the end of this line.  Backslash-newlines don't mean the end.  */
-
    p = child->command_ptr;
    child->noerror = 0;
    while (*p != '\0')
--- 586,591 ----
***************
*** 1041,1046 ****
--- 1039,1045 ----
    register char *ap;
    char *end;
    int instring;
+   int backslash;
    char **new_argv = 0;

    /* See if it is safe to parse commands internally.  */
***************
*** 1165,1170 ****
--- 1164,1204 ----
        /* Free the old argument list we were working on.  */
        free (new_argv[0]);
        free (new_argv);
+     }
+
+   /* Find the end of this line.  Backslash-newlines don't mean the end. */
+   end = line;
+   while (*end != '\0')
+     {
+       p = index (end, '\n');
+       if (p == 0)
+ 	{
+ 	  end += strlen (end);
+ 	  break;
+ 	}
+
+       end = p;
+       backslash = 0;
+       while (*--p == '\\')
+ 	backslash = !backslash;
+
+       if (backslash)
+ 	{
+           ++end;
+           /* If there is a tab after a backslash-newline,
+              remove it, since it was most likely used to line
+              up the continued line with the previous one.  */
+           if (*end == '\t')
+             strcpy (end, end + 1);
+         }
+       else
+         break;
+     }
+
+   if (*end != '\0')
+     {
+       *end = '\0';
+       *restp = end;
      }

    if (shell == 0 || !strcmp (shell, default_shell))
Technical Details
Message-ID: <9208262115.AA19691@rangoon.gain.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!gain.COM!jtc

Show Full Headers
Complete Article Headers
Newsgroups: gnu.utils.bug
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!gain.COM!jtc
From: jtc@gain.COM (J.T. Conklin)
Subject: Re: `canned' command sequences no longer work in gmake-3.62
Message-ID: <9208262115.AA19691@rangoon.gain.com>
Sender: gnulists@ai.mit.edu
Reply-To: jtc@gain.com
Organization: GAIN Technology Inc., Palo Alto, CA
Distribution: gnu
Date: Wed, 26 Aug 1992 07:15:10 GMT
Approved: bug-gnu-utils@prep.ai.mit.edu
Lines: 78