summaryrefslogtreecommitdiff
path: root/userspace/foolshell.c
diff options
context:
space:
mode:
authorMichal Idziorek <m.i@gmx.at>2015-05-13 23:58:39 +0200
committerMichal Idziorek <m.i@gmx.at>2015-05-13 23:58:39 +0200
commitb74c5c8fb4de3b2847bc942e57dcf8f0dea705be (patch)
treefa0a9001cffa64c9193689066bf296dc3df7f844 /userspace/foolshell.c
parent9a60edf72a3112adae4a914134da1adaf472ad5d (diff)
fixed libc and 'userspace'
Diffstat (limited to 'userspace/foolshell.c')
-rw-r--r--userspace/foolshell.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/userspace/foolshell.c b/userspace/foolshell.c
index 3a87158..da05e96 100644
--- a/userspace/foolshell.c
+++ b/userspace/foolshell.c
@@ -45,6 +45,7 @@ int main(int argc, char **argv)
if(!silent)hello();
char *buf=malloc(256);
+ // printf("malloc returned: 0x%08X\n",buf);
while(1)
{
@@ -87,8 +88,6 @@ char **tokenize(char *buf)
i++;
}
token[c][t]=0;
-
-
// printf("token %i : <%s>\n",c, token[c]);
c++;
@@ -216,15 +215,17 @@ int process(char *buf)
int pid=fork();
if(pid!=0)
{
- //printf("new task pid: %i \n",pid);
+ printf("new task pid: %i \n",pid);
}
if(pid==0)
{
char buf[256];
sprintf(buf,"%s",token[0]);
execve(buf,token,environ);
- sprintf(buf,"%s/%s",getenv("PATH"),token[0]);
+ //sprintf(buf,"%s/%s",getenv("PATH"),token[0]);
+ sprintf(buf,"%s/%s","/bin",token[0]);
execve(buf,token,environ);
+
puts("foolshell: command not found");
exit(1);
}