git://scm.lunaixsky.com
/
lunaix-os.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Multiuser, Capabilities and Access Controls (#54)
[lunaix-os.git]
/
lunaix-os
/
usr
/
sh
/
sh.c
diff --git
a/lunaix-os/usr/sh/sh.c
b/lunaix-os/usr/sh/sh.c
index 33f0b030b1372b860afff9b8cda068d8ef59b5fe..764404b0910a54fe50c33891b20967388c3de20e 100644
(file)
--- a/
lunaix-os/usr/sh/sh.c
+++ b/
lunaix-os/usr/sh/sh.c
@@
-128,8
+128,8
@@
sh_exec(const char** argv)
}
char buffer[1024];
}
char buffer[1024];
- strcpy(buffer, "/
usr/
bin/");
- strcpy(&buffer[
9
], name);
+ strcpy(buffer, "/bin/");
+ strcpy(&buffer[
5
], name);
pid_t p;
int res;
pid_t p;
int res;
@@
-182,7
+182,7
@@
sh_loop()
while (1) {
getcwd(pwd, 512);
while (1) {
getcwd(pwd, 512);
- printf("
[%s]$
", pwd);
+ printf("
%s #
", pwd);
int sz = read(stdin, buf, 511);
if (sz < 0) {
int sz = read(stdin, buf, 511);
if (sz < 0) {
@@
-195,8
+195,7
@@
sh_loop()
// currently, this shell only support single argument
if (!parse_cmdline(buf, argv)) {
// currently, this shell only support single argument
if (!parse_cmdline(buf, argv)) {
- printf("\n");
- goto cont;
+ continue;
}
// cmd=="exit"
}
// cmd=="exit"
@@
-204,9
+203,7
@@
sh_loop()
break;
}
break;
}
- sh_exec((const char**)argv);
- cont:
- printf("\n");
+ sh_exec((const char**)argv);
}
}
}
}