v1 patch failed on simple
./scripts/run.py -e "/asdf"
Problem was in:
[PATCH 4/6] command line: use loader_parse_cmdline
core/commands:cc
assert(cmdline == __loader_argv[0]);
v2 updates only this. The string returned by strdup is now stored into
static variable, so it can be easly free-d later.
Always parse app_cmdline. It there is nothing to run, commands array
will be empty.
Signed-off-by: Justin Cinkelj
---
loader.cc | 8
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/loader.cc b/loader.cc
index 504e230..c3a7256 100644
--- a/loader.cc
+++ b/loader.cc
@@ -295,
memcpy had of-by-one error.
Also, remove unneeded defines.
Signed-off-by: Justin Cinkelj
---
libc/string/stresep.c | 16 ++--
1 file changed, 2 insertions(+), 14 deletions(-)
diff --git a/libc/string/stresep.c b/libc/string/stresep.c
index 4d72391..5ac4b85 100644
--- a/libc/string/s
loader_parse_cmdline accepts input str - OSv commandline, say:
--env=AA=aa --env=BB=bb1\ bb2 app.so arg1 arg2
The loader options are parsed and saved into argv, up to first not-loader-option
token. argc is set to number of loader options.
app_cmdline is set to unconsumed part of input str.
Note:
Parse loader options with loader_parse_cmdline instead of strtok_r.
The cmdline passed in prepare_commands to osv::parse_command_line
is not reassebled from already parsed argv anymore, as app_cmdline
contains unmodifed commandline string (only loader options are removed).
Minor bug: commandline w
File is literal copy from
ftp.tku.edu.tw/NetBSD/NetBSD-current/src/lib/libc/string/stresep.c
Signed-off-by: Justin Cinkelj
---
Makefile | 1 +
include/api/string.h | 1 +
libc/string/stresep.c | 94 +++
3 files changed, 96 insertion
Signed-off-by: Justin Cinkelj
---
tests/tst-commands.cc | 57 +++
1 file changed, 57 insertions(+)
diff --git a/tests/tst-commands.cc b/tests/tst-commands.cc
index 78f4155..cc7ffdc 100644
--- a/tests/tst-commands.cc
+++ b/tests/tst-commands.cc
@@ -
Always parse app_cmdline. It there is nothing to run, commands array
will be empty.
Signed-off-by: Justin Cinkelj
---
loader.cc | 8
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/loader.cc b/loader.cc
index 504e230..c3a7256 100644
--- a/loader.cc
+++ b/loader.cc
@@ -295,
loader_parse_cmdline accepts input str - OSv commandline, say:
--env=AA=aa --env=BB=bb1\ bb2 app.so arg1 arg2
The loader options are parsed and saved into argv, up to first not-loader-option
token. argc is set to number of loader options.
app_cmdline is set to unconsumed part of input str.
Note:
Signed-off-by: Justin Cinkelj
---
tests/tst-commands.cc | 57 +++
1 file changed, 57 insertions(+)
diff --git a/tests/tst-commands.cc b/tests/tst-commands.cc
index 78f4155..cc7ffdc 100644
--- a/tests/tst-commands.cc
+++ b/tests/tst-commands.cc
@@ -
Parse loader options with loader_parse_cmdline instead of strtok_r.
The cmdline passed in prepare_commands to osv::parse_command_line
is not reassebled from already parsed argv anymore, as app_cmdline
contains unmodifed commandline string (only loader options are removed).
Minor bug: commandline w
memcpy had of-by-one error.
Also, remove unneeded defines.
Signed-off-by: Justin Cinkelj
---
libc/string/stresep.c | 16 ++--
1 file changed, 2 insertions(+), 14 deletions(-)
diff --git a/libc/string/stresep.c b/libc/string/stresep.c
index 4d72391..5ac4b85 100644
--- a/libc/string/s
This patches allow to set environment variables with spaces via run.py,
as is
run.py -e '--env=AAA=aaa\ bbb /hello_env.so arg1 arg2'
The spaces has to be escaped with \.
stresep implementation is from NetBSD.
The hello-world example of using stresep (NetSBD man page,
http://netbsd.gw.com/cgi-bin/
File is literal copy from
ftp.tku.edu.tw/NetBSD/NetBSD-current/src/lib/libc/string/stresep.c
Signed-off-by: Justin Cinkelj
---
Makefile | 1 +
include/api/string.h | 1 +
libc/string/stresep.c | 94 +++
3 files changed, 96 insertion
14 matches
Mail list logo