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

 
 

bug #24405: BATCH_MODE_ONLY_SHELL configuration fails with unixy shells

Submitter:  None
Submitted:  Mon 29 Sep 2008 06:43:03 PM UTC
   
 
Severity:  3 - Normal Item Group:  Bug
Status:  Fixed Privacy:  Public
Assigned to:  None Open/Closed:  Closed
Component Version:  3.81 Operating System:  MS Windows
Fixed Release:  3.82 Triage Status:  Verified
* Mandatory Fields

Add a New Comment Rich Markup
   

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

This bug was fixed in Make 3.82.

Eli Zaretskii <eliz>
Group 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 Files:
   
   
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
  • -email is unavailable- added by eliz (Posted a comment)
  • -email is unavailable- added by sevanath (Posted a comment)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2013-04-27 eliz StatusNone Fixed
        Open/ClosedOpen Closed
        Fixed ReleaseNone 3.82
        Triage StatusNone Verified
    2008-09-29 None Attached File- Added batch_only_patch.txt, #16586

    Back to the top

    Powered by Savane 3.13-b921.
    Corresponding source code