rewrite comments

This commit is contained in:
Night Kaly 2024-01-31 01:08:35 +00:00
parent 10d9c9dec9
commit 2acfcb280c
No known key found for this signature in database
GPG key ID: 8E829D3381CFEBBE
2 changed files with 2 additions and 11 deletions

View file

@ -3,7 +3,6 @@
#include <stdlib.h> #include <stdlib.h>
// color str in place // color str in place
void color_text(char str[], const char *color) { 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 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) { if (size < 0) {

12
rush.c
View file

@ -73,11 +73,7 @@ int rush_exit(char **args) {
return 0; // exit prompting loop, which also the shell return 0; // exit prompting loop, which also the shell
} }
/** // launch program and wait it to terminate, return 1 to continue running
@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.
*/
int rush_launch(char **args) { int rush_launch(char **args) {
pid_t pid, wpid; pid_t pid, wpid;
int status; int status;
@ -103,11 +99,7 @@ int rush_launch(char **args) {
return 1; return 1;
} }
/** // execute built in commands or launch commands, return 1 to keep shell running
@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
*/
int rush_execute(char **args) { int rush_execute(char **args) {
if (args[0] == NULL) { if (args[0] == NULL) {
// An empty command was entered. // An empty command was entered.