bugmake - Bugs: bug #35397, make bug with ONESHELL and...

 
 

bug #35397: make bug with ONESHELL and SHELLFLAGS

Submitted by:  David Boyce <boyski>
Submitted on:  Sun 29 Jan 2012 08:22:36 PM UTC  
 
Severity: 3 - NormalItem Group: Bug
Status: FixedPrivacy: Public
Assigned to: Paul D. Smith <psmith>Open/Closed: Closed
Component Version: 3.82Operating System: Any
Fixed Release: 4.0Triage Status: None

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Sat 03 Mar 2012 10:57:46 PM UTC, comment #1:

I fixed this although I implemented it differently (using make's find_next_token() function rather than strtok()). Also added a test to the regression suite.

Paul D. Smith <psmith>
Project AdministratorIn charge of this item.
Sun 29 Jan 2012 08:22:36 PM UTC, original submission:

In a thread from the bug-make mailing list (http://lists.gnu.org/archive/html/bug-make/2011-12/msg00039.html) a bug was reported and the following patch was provided and reported to work fine. I 'm filing this report to ensure the issue gets proper review and disposition before the upcoming release.

The original report said:
====================================================
SHELL = /bin/bash
.SHELLFLAGS = -e –o pipefail -c

Works

.ONESHELL:
SHELL = /bin/bash
.SHELLFLAGS = -e –o pipefail –c

Doesn’t.

When the ONESHELL target is set .SHELLFLAGS must be set to a single value, i.e. –ec.
====================================================

Index: job.c
===================================================================
RCS file: /sources/make/make/job.c,v
retrieving revision 1.215
diff -u -r1.215 job.c
--- job.c 15 Nov 2011 21:12:54 -0000 1.215
+++ job.c 22 Dec 2011 21:31:48 -0000
@@ -2960,12 +2960,21 @@
*t = '\0';
}

- new_argv = xmalloc (4 * sizeof (char *));
- new_argv[0] = xstrdup(shell);
- new_argv[1] = xstrdup(shellflags ? shellflags : "");
- new_argv[2] = line;
- new_argv[3] = NULL;
- return new_argv;
+ {
+ char *sfcopy;
+ char *sftok;
+ int n = 0;
+
+ sfcopy = xstrdup(shellflags ? shellflags : "");
+ new_argv = xmalloc ((4 + sflags_len/2) * sizeof (char *));
+ new_argv[n++] = xstrdup(shell);
+ for (sftok = strtok(sfcopy, " "); sftok; sftok = strtok(NULL, " "))
+ new_argv[n++] = xstrdup(sftok);
+ new_argv[n++] = line;
+ new_argv[n] = NULL;
+ free(sfcopy);
+ return new_argv;
+ }
}

new_line = alloca ((shell_len*2) + 1 + sflags_len + 1

David Boyce <boyski>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by psmith (Posted a comment)
  • -unavailable- added by boyski (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat 03 Mar 2012 10:57:46 PM UTCpsmithStatusNone=>Fixed
      Assigned toNone=>psmith
      Open/ClosedOpen=>Closed
      Fixed ReleaseNone=>4.0

    Back to the top


    Powered by Savane 3.1-cleanup1