Skip to content

Commit af5a5e0

Browse files
committed
Merge branch 'spawn-with-spaces'
This change lets us spawn .bat scripts whose paths contain spaces. Signed-off-by: Johannes Schindelin <[email protected]>
2 parents fce9915 + 8086988 commit af5a5e0

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ GIT-VERSION-FILE: FORCE
377377

378378
# CFLAGS and LDFLAGS are for the users to override from the command line.
379379

380-
CFLAGS = -g -O2 -Wall
380+
CFLAGS = -g -Wall
381381
LDFLAGS =
382382
ALL_CFLAGS = $(CPPFLAGS) $(CFLAGS)
383383
ALL_LDFLAGS = $(LDFLAGS)

compat/mingw.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1271,7 +1271,9 @@ static pid_t mingw_spawnve_fd(const char *cmd, const char **argv, char **deltaen
12711271
si.hStdError = winansi_get_osfhandle(fherr);
12721272

12731273
/* executables and the current directory don't support long paths */
1274-
if (xutftowcs_path(wcmd, cmd) < 0)
1274+
if (*argv && !strcmp(cmd, *argv))
1275+
wcmd[0] = L'\0';
1276+
else if (xutftowcs_path(wcmd, cmd) < 0)
12751277
return -1;
12761278
if (dir && xutftowcs_path(wdir, dir) < 0)
12771279
return -1;
@@ -1310,8 +1312,8 @@ static pid_t mingw_spawnve_fd(const char *cmd, const char **argv, char **deltaen
13101312
wenvblk = make_environment_block(deltaenv);
13111313

13121314
memset(&pi, 0, sizeof(pi));
1313-
ret = CreateProcessW(wcmd, wargs, NULL, NULL, TRUE, flags,
1314-
wenvblk, dir ? wdir : NULL, &si, &pi);
1315+
ret = CreateProcessW(*wcmd ? wcmd : NULL, wargs, NULL, NULL, TRUE,
1316+
flags, wenvblk, dir ? wdir : NULL, &si, &pi);
13151317

13161318
free(wenvblk);
13171319
free(wargs);

config.mak.uname

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -545,8 +545,6 @@ else
545545
prefix = /usr/
546546
# Enable DEP
547547
BASIC_LDFLAGS += -Wl,--nxcompat
548-
# Enable ASLR
549-
BASIC_LDFLAGS += -Wl,--dynamicbase
550548
ifeq (MINGW32,$(MSYSTEM))
551549
prefix = /mingw32
552550
BASIC_LDFLAGS += -Wl,--pic-executable,-e,_mainCRTStartup

0 commit comments

Comments
 (0)