aboutsummaryrefslogtreecommitdiff
path: root/sys/cmd/rc/sys.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/cmd/rc/sys.c')
-rw-r--r--sys/cmd/rc/sys.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/cmd/rc/sys.c b/sys/cmd/rc/sys.c
index 86c430e..807359d 100644
--- a/sys/cmd/rc/sys.c
+++ b/sys/cmd/rc/sys.c
@@ -76,19 +76,19 @@ execute(Word *cmd, Word *path)
nc = strlen(path->str);
if(nc < arrlen(file)){
strcpy(file, path->str);
- if(*file){
+ if(file[0]){
strcat(file, "/");
nc++;
}
- if(nc+strlen(argv[1]) < 1024){
+ if(nc+strlen(argv[1]) < arrlen(file)){
strcat(file, argv[1]);
execve(file, argv+1, env);
}else
fatal("command name too long");
}
}
+ print(shell.err, "could not execute command: %s\n", argv[1]);
efree(argv);
- fatal("could not execute command: %s\n", path->str);
}
void