-Subproject commit beedfb79168cadd181b26ee46e50a01a6a44de52
+Subproject commit e998819b1d1e191d035600967abd84e9f2eb9cf8
To add a built-in command to the shell, first make a source file in the `src/builtins/` directory with the same name as the built-in. The source file should contain at least the following code (where "foo" is the name of the built-in).
```c
-// foo.c
+/* foo.c */
#include <stdlib.h>
int gethistory(int back, char *buffer) {
if (history.c == (back ? history.b : history.t)) return 0;
- // Save the most recently modified history entry at the top of the list
+ /* Save the most recently modified history entry at the top of the list */
if (strcmp(history.entries[history.c], buffer) != 0)
strcpy(history.entries[history.t], buffer);
CLEAR = '\014',
ESCAPE = '\033',
- // See ESCAPE case in userinput()
+ /* See ESCAPE case in userinput() */
ALT = '2' + 1,
UP = 'A',
end = c->string;
while (*end && *end != '\n') ++end;
l = end - c->string;
- while (*end == '\n') ++end; // scriptinput() repeatedly uses stringinput()
+ while (*end == '\n') ++end; /* scriptinput() repeatedly uses stringinput() */
if (l > MAXCHARS) {
note("Line too long, exceeds %d character limit", MAXCHARS);
return 0;