Skip to content

Commit

Permalink
Fix alias bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Edd12321 committed May 27, 2023
1 parent 8b9276c commit 2ddc22a
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
8 changes: 8 additions & 0 deletions .zrc
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,14 @@ alias 666 "chmod 666"
alias 755 "chmod 755"
alias 777 "chmod 777"

alias str string
alias strcmp 'string cmp'
alias strcat 'string cat'
alias strlen 'string length'
alias sizeof 'array length'

alias arr array

fn mkcd { mkdir $argv(1) && cd $argv(1); }
fn lcd { cd $argv(1) && l }

Expand Down
2 changes: 0 additions & 2 deletions examples/sv_log.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
[SSH agent killed]
[Remote-controlled dialog window]
[Exiting server]
1 change: 0 additions & 1 deletion src/dispatch.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,6 @@ Command(alias) {
if (argc == 3) {
NullFin;
aliases[argv[1]] = tokenize(argv[2], fin);
std::for_each(aliases[argv[1]].wl.begin(), aliases[argv[1]].wl.end(), &str_subst);
} else if (argc == 1) {
for (auto const& it : aliases) {
std::cout << "alias " << it.first << " {";
Expand Down
2 changes: 1 addition & 1 deletion src/sighandler.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ sigchld_handler(int signum)
}
if (WIFEXITED(cs)) {
if (TERMINAL && mode == BG)
std::cerr << FMT << strsignal(WEXITSTATUS(cs)) << '\n';
std::cerr << FMT << "Done\n";
deljob(index);
ret_val = itoa(WEXITSTATUS(cs));
}
Expand Down

0 comments on commit 2ddc22a

Please sign in to comment.