projects
/
pintos-anon
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add priority-donate-lower to rubric.
[pintos-anon]
/
src
/
examples
/
shell.c
diff --git
a/src/examples/shell.c
b/src/examples/shell.c
index d31eb3a9a67c534199f0731165295e0a117b1b7e..916d25267ac758a198fb4d299af7fa54edf5bfd4 100644
(file)
--- a/
src/examples/shell.c
+++ b/
src/examples/shell.c
@@
-21,6
+21,11
@@
main (void)
/* Execute command. */
if (!strcmp (command, "exit"))
break;
/* Execute command. */
if (!strcmp (command, "exit"))
break;
+ else if (!memcmp (command, "cd ", 3))
+ {
+ if (!chdir (command + 3))
+ printf ("\"%s\": chdir failed\n", command + 3);
+ }
else if (command[0] == '\0')
{
/* Empty command. */
else if (command[0] == '\0')
{
/* Empty command. */
@@
-36,7
+41,7
@@
main (void)
}
printf ("Shell exiting.");
}
printf ("Shell exiting.");
- return
0
;
+ return
EXIT_SUCCESS
;
}
/* Reads a line of input from the user into LINE, which has room
}
/* Reads a line of input from the user into LINE, which has room