home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / gnu / utils / bug / 1419 < prev    next >
Encoding:
Text File  |  1992-08-26  |  2.3 KB  |  92 lines

  1. Newsgroups: gnu.utils.bug
  2. Path: sparky!uunet!cis.ohio-state.edu!gain.COM!jtc
  3. From: jtc@gain.COM (J.T. Conklin)
  4. Subject: Re: `canned' command sequences no longer work in gmake-3.62
  5. Message-ID: <9208262115.AA19691@rangoon.gain.com>
  6. Sender: gnulists@ai.mit.edu
  7. Reply-To: jtc@gain.com
  8. Organization: GAIN Technology Inc., Palo Alto, CA
  9. Distribution: gnu
  10. Date: Wed, 26 Aug 1992 07:15:10 GMT
  11. Approved: bug-gnu-utils@prep.ai.mit.edu
  12. Lines: 78
  13.  
  14. Earlier today, I sent a bug report about `canned' command sequences
  15. (defined with "define ... endef") not working with gmake-3.62.
  16.  
  17. I copied the code from gmake-3.60, into the appropriate place in
  18. construct_command_line_internal() and everything works as before.
  19.  
  20. Patch follows:
  21.  
  22. *** ../make-3.62/job.c    Thu Oct 24 14:58:33 1991
  23. --- job.c    Wed Aug 26 13:52:43 1992
  24. ***************
  25. *** 586,593 ****
  26.       /* Still executing the last line we started.  */
  27.       recursive = child->file->cmds->lines_recurse[child->command_line - 1];
  28.  
  29. -   /* Find the end of this line.  Backslash-newlines don't mean the end.  */
  30. -
  31.     p = child->command_ptr;
  32.     child->noerror = 0;
  33.     while (*p != '\0')
  34. --- 586,591 ----
  35. ***************
  36. *** 1041,1046 ****
  37. --- 1039,1045 ----
  38.     register char *ap;
  39.     char *end;
  40.     int instring;
  41. +   int backslash;
  42.     char **new_argv = 0;
  43.  
  44.     /* See if it is safe to parse commands internally.  */
  45. ***************
  46. *** 1165,1170 ****
  47. --- 1164,1204 ----
  48.         /* Free the old argument list we were working on.  */
  49.         free (new_argv[0]);
  50.         free (new_argv);
  51. +     }
  52. +
  53. +   /* Find the end of this line.  Backslash-newlines don't mean the end. */
  54. +   end = line;
  55. +   while (*end != '\0')
  56. +     {
  57. +       p = index (end, '\n');
  58. +       if (p == 0)
  59. +     {
  60. +       end += strlen (end);
  61. +       break;
  62. +     }
  63. +
  64. +       end = p;
  65. +       backslash = 0;
  66. +       while (*--p == '\\')
  67. +     backslash = !backslash;
  68. +
  69. +       if (backslash)
  70. +     {
  71. +           ++end;
  72. +           /* If there is a tab after a backslash-newline,
  73. +              remove it, since it was most likely used to line
  74. +              up the continued line with the previous one.  */
  75. +           if (*end == '\t')
  76. +             strcpy (end, end + 1);
  77. +         }
  78. +       else
  79. +         break;
  80. +     }
  81. +
  82. +   if (*end != '\0')
  83. +     {
  84. +       *end = '\0';
  85. +       *restp = end;
  86.       }
  87.  
  88.     if (shell == 0 || !strcmp (shell, default_shell))
  89.  
  90.  
  91.  
  92.