summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorÁkos Kőrösi <korakos99@gmail.com>2026-05-21 21:19:04 +0200
committerÁkos Kőrösi <korakos99@gmail.com>2026-05-21 21:19:04 +0200
commit6b1cb479a7b8939e8d38479191b4ce7447033b5f (patch)
treea59390b53a63ea569a8f4bc31cd88979e35e29a4 /src
parent6a04328f732522d20b10138fc804ac8c7ab9a9d3 (diff)
remove diagnostic prints
Diffstat (limited to 'src')
-rw-r--r--src/exec.c5
-rw-r--r--src/utils.c1
2 files changed, 1 insertions, 5 deletions
diff --git a/src/exec.c b/src/exec.c
index 0c53971..a65b442 100644
--- a/src/exec.c
+++ b/src/exec.c
@@ -15,7 +15,6 @@ void execute_command_pipeline(Pipeline pipeline, int stdin_fd, int stdout_fd, bo
DECLARE_MAYBE(StrPair, MaybeStrPair)
MaybeStrPair parse_assignment(char* token) {
- printf("%s\n", token);
// TODO: ideally shouldn't mutate maybe
if (token == NULL) return (MaybeStrPair){.some = false};
char* eq = strchr(token, '=');
@@ -41,7 +40,6 @@ bool handle_builtin(ExecutableCommand cmd, ShellState* shstate) {
// TODO: if no arg1 -> print alias list
MaybeStrPair m_assignment = parse_assignment(cmd.args[1]);
assert(m_assignment.some);
- printf("%s:%s\n", m_assignment.value.key, m_assignment.value.val);
set_map_pair(&shstate->aliases, m_assignment.value);
return true;
}
@@ -163,6 +161,7 @@ ExecutableCommand process_pl_command(PlCommand pl_cmd, int* pgid, ShellState* sh
push_to_FdRedirectVec(&fd_redirs, fd_redir);
}
+ // TODO: I think dealiasing has certain preconditions, like arg0 not being expanded before(?).
char** args = malloc(sizeof(char*) * (arg_vec.count + 1));
for (int i = 0; i < arg_vec.count; i++) {
if (i == 0) {
@@ -170,9 +169,7 @@ ExecutableCommand process_pl_command(PlCommand pl_cmd, int* pgid, ShellState* sh
MaybeStr m_dealias = get_map_value(&shstate->aliases, arg);
if (m_dealias.some) {
args[0] = m_dealias.value;
- printf("%s\n", args[0]);
} else {
- printf("Nah\n");
args[0] = arg;
}
} else {
diff --git a/src/utils.c b/src/utils.c
index 1110194..c828f8e 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -40,7 +40,6 @@ void set_map_pair(KeyValMap* map, StrPair pair) {
}
MaybeStr get_map_value(KeyValMap* map, char* key) {
- printf("%d\n", map->count);
for (int i = 0; i < map->count; i++) {
char* key_i = get_from_KeyValMap(map, i)->key;
if (key_i == NULL) continue;