aboutsummaryrefslogtreecommitdiffstats
path: root/erts/etc/common/dialyzer.c
diff options
context:
space:
mode:
Diffstat (limited to 'erts/etc/common/dialyzer.c')
-rw-r--r--erts/etc/common/dialyzer.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/erts/etc/common/dialyzer.c b/erts/etc/common/dialyzer.c
index cac1464bf6..c45626606c 100644
--- a/erts/etc/common/dialyzer.c
+++ b/erts/etc/common/dialyzer.c
@@ -65,6 +65,7 @@ static int eargc; /* Number of arguments in eargv. */
static void error(char* format, ...);
static char* emalloc(size_t size);
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__
@@ -188,7 +189,7 @@ int main(int argc, char** argv)
eargv_base = (char **) emalloc(eargv_size*sizeof(char*));
eargv = eargv_base;
eargc = 0;
- PUSH(strsave(emulator));
+ push_words(emulator);
eargc_base = eargc;
eargv = eargv + eargv_size/2;
eargc = 0;
@@ -268,6 +269,27 @@ int main(int argc, char** argv)
return run_erlang(eargv[0], eargv);
}
+static void
+push_words(char* src)
+{
+ char sbuf[MAXPATHLEN];
+ 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)
{