summaryrefslogtreecommitdiff
path: root/com32
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2009-03-14 16:18:44 -0700
committerH. Peter Anvin <hpa@zytor.com>2009-03-14 16:18:44 -0700
commit1cb786fc4c9a11179b73d6f5005a2bd990a51b92 (patch)
tree7073cbc9fec94b489d492b51f59f4737c694b67a /com32
parent662e44df5fefa9da266941b63557c55286637a29 (diff)
downloadsyslinux-1cb786fc4c9a11179b73d6f5005a2bd990a51b92.tar.gz
cmd.c32: simplify by passing the unparsed command line
Instead of parsing and unparsing the command line, just pass the raw command line the way we already have it.
Diffstat (limited to 'com32')
-rw-r--r--com32/modules/cmd.c24
1 files changed, 3 insertions, 21 deletions
diff --git a/com32/modules/cmd.c b/com32/modules/cmd.c
index e1d646b5..1a7f0ffe 100644
--- a/com32/modules/cmd.c
+++ b/com32/modules/cmd.c
@@ -16,28 +16,10 @@
* Execute arbitrary commands
*/
-#include <string.h>
-#include <alloca.h>
#include <com32.h>
-int main(int argc, const char *argv[])
+int main(void)
{
- size_t len = 0;
- char *cmd;
- char *tmp;
- int i;
-
- for (i = 1; i < argc; i++)
- len += strlen(argv[i]) + 1;
-
- tmp = cmd = alloca(len);
-
- for (i = 1; i < argc; i++) {
- tmp = strpcpy(tmp, argv[i]);
- if (i != argc-1)
- *tmp++ = ' ';
- }
- *tmp = '\0';
-
- syslinux_run_command(cmd);
+ syslinux_run_command(__com32.cs_cmdline);
+ return -1;
}