aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2016-03-02 14:23:03 +1300
committerTom Ryder <tom@sanctum.geek.nz>2016-03-02 14:23:03 +1300
commit714fbe6eb7c0eb42b46e99dc4be6e45ef414d095 (patch)
tree23cf50fe2b9bfc7ba34450f52583001863d54fb9
parentFirst commit of sps(1) (diff)
downloadspsh-714fbe6eb7c0eb42b46e99dc4be6e45ef414d095.tar.gz
spsh-714fbe6eb7c0eb42b46e99dc4be6e45ef414d095.zip
Quietly ignore empty lines
-rw-r--r--loop.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/loop.c b/loop.c
index 107b4b2..e1cc31a 100644
--- a/loop.c
+++ b/loop.c
@@ -12,7 +12,9 @@ void loop() {
/* If the line is valid, try to run it as a command */
if (line != NULL) {
- cmd(line);
+ if (strlen(line) > 0) {
+ cmd(line);
+ }
}
/* If the line is EOF (^D), break out of the loop */