Changeset 535 for trunk/src/gmake/w32


Ignore:
Timestamp:
Sep 19, 2006, 6:29:18 AM (19 years ago)
Author:
bird
Message:

o A real attempt at fixing the double quoting problem on windows. ash seems to want a

space between a double quote enclosing the last argument on the commandline and the
double quote enclosing the commandline (the -c argument). Also, defined HAVE_CYGWIN_SHELL.

o Fixed a newline escape problem when using batch_mode_shell on windows with kmk_ash.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/gmake/w32/subproc/sub_proc.c

    r503 r535  
    10731073         */
    10741074        bytes_required++;
     1075#ifdef KMK /* for the space before the final " in case we need it. */
     1076        bytes_required++;
     1077#endif
    10751078
    10761079        command_line = (char*) malloc(bytes_required);
     
    11171120                                } else {
    11181121
    1119                                 /*
    1120                                 * We have to insert a backslash for the "
    1121                                 * and each \ that precedes the ".
    1122                                 */
    1123                                 backslash_count++;
    1124 
    1125                                 while(backslash_count) {
    1126                                         *(command_line_i++) = '\\';
    1127                                         backslash_count--;
    1128                                 };
     1122                                        /*
     1123                                        * We have to insert a backslash for the "
     1124                                        * and each \ that precedes the ".
     1125                                        */
     1126                                        backslash_count++;
     1127       
     1128                                        while(backslash_count) {
     1129                                                *(command_line_i++) = '\\';
     1130                                                backslash_count--;
     1131                                        };
    11291132                                }
    11301133#if !defined(HAVE_MKS_SHELL) && !defined(HAVE_CYGWIN_SHELL)
     
    11521155                        };
    11531156#endif
     1157#ifdef KMK
     1158                        /*
     1159                         * ash it put off by echo "hello world" ending up as:
     1160                         *  G:/.../kmk_ash.exe -c "echo ""hello world"""
     1161                         * It wants a space before the last '"'.
     1162                         * (The 'test_shell' goals in Makefile.kmk tests this problem.)
     1163                         */
     1164                        if (command_line_i[-1] == '\"' && cygwin_mode && have_sh && !argvi[1]) {
     1165                            *(command_line_i++) = ' ';
     1166                        }
     1167#endif
    11541168                        *(command_line_i++) = '\"';
    11551169                }
Note: See TracChangeset for help on using the changeset viewer.