* Fix for lcc on windows so that it can execute files with spaces in them
This commit is contained in:
parent
87cd6f8a93
commit
8b63fdab58
1 changed files with 5 additions and 2 deletions
|
@ -256,6 +256,7 @@ static int callsys(char **av) {
|
||||||
int i, status = 0;
|
int i, status = 0;
|
||||||
static char **argv;
|
static char **argv;
|
||||||
static int argc;
|
static int argc;
|
||||||
|
char *executable;
|
||||||
|
|
||||||
for (i = 0; av[i] != NULL; i++)
|
for (i = 0; av[i] != NULL; i++)
|
||||||
;
|
;
|
||||||
|
@ -281,6 +282,8 @@ static int callsys(char **av) {
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
argv[j] = NULL;
|
argv[j] = NULL;
|
||||||
|
executable = strsave( argv[0] );
|
||||||
|
argv[0] = stringf( "\"%s\"", argv[0] );
|
||||||
if (verbose > 0) {
|
if (verbose > 0) {
|
||||||
int k;
|
int k;
|
||||||
fprintf(stderr, "%s", argv[0]);
|
fprintf(stderr, "%s", argv[0]);
|
||||||
|
@ -290,9 +293,9 @@ static int callsys(char **av) {
|
||||||
}
|
}
|
||||||
if (verbose < 2)
|
if (verbose < 2)
|
||||||
#ifndef WIN32
|
#ifndef WIN32
|
||||||
status = _spawnvp(_P_WAIT, argv[0], argv);
|
status = _spawnvp(_P_WAIT, executable, argv);
|
||||||
#else
|
#else
|
||||||
status = _spawnvp(_P_WAIT, argv[0], (const char* const*)argv);
|
status = _spawnvp(_P_WAIT, executable, (const char* const*)argv);
|
||||||
#endif
|
#endif
|
||||||
if (status == -1) {
|
if (status == -1) {
|
||||||
fprintf(stderr, "%s: ", progname);
|
fprintf(stderr, "%s: ", progname);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue