bugmake - Bugs: bug #24405, BATCH_MODE_ONLY_SHELL...

 
 

bug #24405: BATCH_MODE_ONLY_SHELL configuration fails with unixy shells

Submitted by:  None
Submitted on:  Mon 29 Sep 2008 06:43:03 PM UTC  
 
Severity: 3 - NormalItem Group: Bug
Status: FixedPrivacy: Public
Assigned to: NoneOpen/Closed: Closed
Component Version: 3.81Operating System: MS Windows
Fixed Release: 3.82Triage Status: Verified

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Sat 27 Apr 2013 05:27:18 PM UTC, comment #1:

This bug was fixed in Make 3.82.

Eli Zaretskii <eliz>
Project Member
 Spam posted by sevanath
Mon 29 Sep 2008 06:43:03 PM UTC, original submission:

If make determines that the shell is "unixy", the generated shell script used to run a rule containing a continuation character will have one too many '\'s. For example, the following makefile fails:

all:
echo this is\
a test

because the generated "batch" file used to run the echo command above is:

echo this is\\
a test

This results in two commands being executed (by unixy shells); "echo" and "a". Clearly not what was intended.

The attached patch fixes this for me. Note the "DB (DB_JOBS" line is, of course, unnecessary but it's invaluable when trying to debug a BATCH_MODE_ONLY_SHELL configured make.

diff -Naur make-3.81,orig/job.c make-3.81/job.c
--- make-3.81,orig/job.c 2006-03-19 19:03:04.000000000 -0800
+++ make-3.81/job.c 2008-09-27 19:29:03.283931000 -0700
@@ -2733,7 +2733,7 @@
if (PRESERVE_BSNL)
{
*(ap++) = '\\';
- *(ap++) = '\\';
+ if (!batch_mode_shell) *(ap++) = '\\';
*(ap++) = '\n';
}

@@ -2799,6 +2799,9 @@
fputc ('\n', batch);
fclose (batch);

+ DB (DB_JOBS, (_("Batch file contents:%s\n\t%s\n"),
+ !unixy_shell ? "\n\t@echo off" : "", command_ptr));
+
/* create argv */
new_argv = (char *) xmalloc(3 sizeof (char *));
if (unixy_shell) {

Anonymous

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #16586:  batch_only_patch.txt added by None (753B - text/plain - patch to fix reported problem)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by eliz (Posted a comment)
  • -unavailable- added by sevanath (Posted a comment)
  •  

    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 5 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat 27 Apr 2013 05:27:18 PM UTCelizStatusNone=>Fixed
      Open/ClosedOpen=>Closed
      Fixed ReleaseNone=>3.82
      Triage StatusNone=>Verified
    Mon 29 Sep 2008 06:43:03 PM UTCNoneAttached File-=>Added batch_only_patch.txt, #16586

    Back to the top


    Powered by Savane 3.1-cleanup1