90s

Minimalist, customizable shell written in C99 with syntax highlighting
git clone https://codeberg.org/night0721/90s
Log | Files | Refs | README | LICENSE

commit 2acfcb280c3c2a2624595e6abc9fee6a9532b559
parent 10d9c9dec9270a1a652b369e5e184d5df4a02fd0
Author: night0721 <[email protected]>
Date:   Wed, 31 Jan 2024 01:08:35 +0000

rewrite comments

Diffstat:
Mcolor.c | 1-
Mrush.c | 12++----------
2 files changed, 2 insertions(+), 11 deletions(-)

diff --git a/color.c b/color.c @@ -3,7 +3,6 @@ #include <stdlib.h> // color str in place - void color_text(char str[], const char *color) { int size = snprintf(NULL, 0, "\x1b[38;2;%sm%s\x1b[0m", color, str) + 1; // calculate size that is needed for colored string if (size < 0) { diff --git a/rush.c b/rush.c @@ -73,11 +73,7 @@ int rush_exit(char **args) { return 0; // exit prompting loop, which also the shell } -/** - @brief Launch a program and wait for it to terminate. - @param args Null terminated list of arguments (including program). - @return Always returns 1, to continue execution. - */ +// launch program and wait it to terminate, return 1 to continue running int rush_launch(char **args) { pid_t pid, wpid; int status; @@ -103,11 +99,7 @@ int rush_launch(char **args) { return 1; } -/** - @brief Execute shell built-in or launch program. - @param args Null terminated list of arguments. - @return 1 if the shell should continue running, 0 if it should terminate - */ +// execute built in commands or launch commands, return 1 to keep shell running int rush_execute(char **args) { if (args[0] == NULL) { // An empty command was entered.