Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Ledest:erlang:26
erlang
0332-erts-Fix-erroneous-splitting-of-emulator-p...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0332-erts-Fix-erroneous-splitting-of-emulator-path.patch of Package erlang
From d40fd24d58af87ff0a05c71d6ed0b7736c04bb58 Mon Sep 17 00:00:00 2001 From: frazze-jobb <frazze@erlang.org> Date: Mon, 14 Oct 2024 15:20:53 +0200 Subject: [PATCH 1/2] erts: Fix erroneous splitting of emulator path --- erts/etc/common/dialyzer.c | 24 +----------------------- erts/etc/common/erlc.c | 24 +----------------------- erts/etc/common/typer.c | 23 +---------------------- erts/test/erlc_SUITE.erl | 4 ++-- 4 files changed, 5 insertions(+), 70 deletions(-) diff --git a/erts/etc/common/dialyzer.c b/erts/etc/common/dialyzer.c index 8465422684..7f0acc50f8 100644 --- a/erts/etc/common/dialyzer.c +++ b/erts/etc/common/dialyzer.c @@ -60,7 +60,6 @@ static void* emalloc(size_t size); static void efree(void *p); #endif 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__ @@ -213,7 +212,7 @@ int main(int argc, char** argv) eargv_base = (char **) emalloc(eargv_size*sizeof(char*)); eargv = eargv_base; eargc = 0; - push_words(emulator); + PUSH(strsave(emulator)); if (emulator != env) { free(emulator); } @@ -289,27 +288,6 @@ 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) { diff --git a/erts/etc/common/erlc.c b/erts/etc/common/erlc.c index 1493c6f6ff..c6cf0de491 100644 --- a/erts/etc/common/erlc.c +++ b/erts/etc/common/erlc.c @@ -83,7 +83,6 @@ static void* emalloc(size_t size); static void efree(void *p); #endif static char* strsave(char* string); -static void push_words(char* src); static int run_erlang(char* name, char** argv); static void call_compile_server(char** argv); static void encode_env(ei_x_buff* buf); @@ -276,7 +275,7 @@ int 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; @@ -471,27 +470,6 @@ get_env_compile_server(void) "for environment value ERLC_USE_SERVER\n", us); } -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) { diff --git a/erts/etc/common/typer.c b/erts/etc/common/typer.c index a5d4b1c231..93bc644e86 100644 --- a/erts/etc/common/typer.c +++ b/erts/etc/common/typer.c @@ -60,7 +60,6 @@ static void* emalloc(size_t size); static void efree(void *p); #endif 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__ @@ -162,7 +161,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)); free(emulator); eargc_base = eargc; eargv = eargv + eargv_size/2; @@ -216,26 +215,6 @@ 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) { diff --git a/erts/test/erlc_SUITE.erl b/erts/test/erlc_SUITE.erl index c9068164e5..c6f3a2bf31 100644 --- a/erts/test/erlc_SUITE.erl +++ b/erts/test/erlc_SUITE.erl @@ -1188,7 +1188,7 @@ run_command(Dir, {win32, _}, Cmd) -> {BatchFile, Run, ["@echo off\r\n", - "set ERLC_EMULATOR=", ct:get_progname(), "\r\n", + "set ERLC_EMULATOR=", os:find_executable("erl"), "\r\n", Cmd, "\r\n", "if errorlevel 1 echo _ERROR_\r\n", "if not errorlevel 1 echo _OK_\r\n"]}; @@ -1197,7 +1197,7 @@ run_command(Dir, {unix, _}, Cmd) -> {Name, "/bin/sh " ++ Name, ["#!/bin/sh\n", - "ERLC_EMULATOR='", ct:get_progname(), "'\n", + "ERLC_EMULATOR='", os:find_executable("erl"), "'\n", "export ERLC_EMULATOR\n", Cmd, "\n", "case $? in\n", -- 2.43.0
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor