aboutsummaryrefslogtreecommitdiffstats
path: root/erts/etc/common/escript.c
diff options
context:
space:
mode:
authorZandra <[email protected]>2015-11-17 13:01:44 +0100
committerZandra <[email protected]>2015-11-17 13:01:44 +0100
commita7f3e7c6e65d845e8a6d0c5e3b5fad83c1036ace (patch)
tree9f9e85cdf1237a74d71a4398f5a089d528df256d /erts/etc/common/escript.c
parente9442a7b93f6946b736b6b1e3621b405667ef672 (diff)
parentd42741c7ec0cfe8287a2866a5e837d4da26a97ca (diff)
downloadotp-a7f3e7c6e65d845e8a6d0c5e3b5fad83c1036ace.tar.gz
otp-a7f3e7c6e65d845e8a6d0c5e3b5fad83c1036ace.tar.bz2
otp-a7f3e7c6e65d845e8a6d0c5e3b5fad83c1036ace.zip
Merge branch 'maint'
Diffstat (limited to 'erts/etc/common/escript.c')
-rw-r--r--erts/etc/common/escript.c25
1 files changed, 2 insertions, 23 deletions
diff --git a/erts/etc/common/escript.c b/erts/etc/common/escript.c
index 7fd02ed436..a5c6d0d40b 100644
--- a/erts/etc/common/escript.c
+++ b/erts/etc/common/escript.c
@@ -74,7 +74,6 @@ static void error(char* format, ...);
static char* emalloc(size_t size);
static void efree(void *p);
static char* strsave(char* string);
-static void push_words(char* src);
static int run_erlang(char* name, char** argv);
static char* get_default_emulator(char* progname);
#ifdef __WIN32__
@@ -432,7 +431,7 @@ main(int argc, char** argv)
emulator = get_default_emulator(argv[0]);
}
- if (strlen(emulator) >= PMAX)
+ if (strlen(emulator) >= MAXPATHLEN)
error("Value of environment variable ESCRIPT_EMULATOR is too large");
/*
@@ -445,7 +444,7 @@ main(int argc, char** argv)
eargv_base = (char **) emalloc(eargv_size*sizeof(char*));
eargv = eargv_base;
eargc = 0;
- push_words(emulator);
+ PUSH(strsave(emulator));
eargc_base = eargc;
eargv = eargv + eargv_size/2;
eargc = 0;
@@ -554,26 +553,6 @@ main(int argc, char** argv)
return run_erlang(eargv[0], eargv);
}
-static void
-push_words(char* src)
-{
- char sbuf[PMAX];
- char* dst;
-
- dst = sbuf;
- while ((*dst++ = *src++) != '\0') {
- if (isspace((int)*src)) {
- *dst = '\0';
- PUSH(strsave(sbuf));
- dst = sbuf;
- do {
- src++;
- } while (isspace((int)*src));
- }
- }
- if (sbuf[0])
- PUSH(strsave(sbuf));
-}
#ifdef __WIN32__
wchar_t *make_commandline(char **argv)
{