Skip to content
Snippets Groups Projects
Commit e98fad1d authored by cxb23's avatar cxb23
Browse files

fixed "rc" functionality

parent 383def34
Branches
No related tags found
No related merge requests found
File added
No preview for this file type
...@@ -97,7 +97,7 @@ EOF ...@@ -97,7 +97,7 @@ EOF
@test "It handles quoted spaces" { @test "It handles quoted spaces" {
run "./dsh" <<EOF run "./dsh" <<EOF
echo " hello world " echo " hello world "
EOF EOF
# Strip all whitespace (spaces, tabs, newlines) from the output # Strip all whitespace (spaces, tabs, newlines) from the output
......
...@@ -12,3 +12,12 @@ EOF ...@@ -12,3 +12,12 @@ EOF
# Assertions # Assertions
[ "$status" -eq 0 ] [ "$status" -eq 0 ]
} }
@test "Change directory to bats" {
run ./dsh <<EOF
cd bats
EOF
[ "$stripped_output" = "$expected_output" ]
[ "$status" -eq 0]
}
No preview for this file type
...@@ -197,7 +197,7 @@ int exec_local_cmd_loop() ...@@ -197,7 +197,7 @@ int exec_local_cmd_loop()
if (strcmp(cmd_buff, "rc") == 0) { if (strcmp(cmd_buff, "rc") == 0) {
printf("%d\n", rc); printf("%d\n", rc);
if ((rc = clear_cmd_buff(cmd)) != OK_EXIT) exit(rc); //if ((rc = clear_cmd_buff(cmd)) != OK_EXIT) exit(rc);
continue; continue;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment