aboutsummaryrefslogtreecommitdiffstats
path: root/loc.c
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2018-02-19 19:24:37 +0100
committerMattias Andrée <maandree@kth.se>2018-02-19 19:24:37 +0100
commitdc0349df102935554f453a5d68a60f27fe38a09b (patch)
tree2983385577b8d97c0d0969d581907dfa70cdcbd9 /loc.c
parentAdd readme and loc.1 (diff)
downloadloc-dc0349df102935554f453a5d68a60f27fe38a09b.tar.gz
loc-dc0349df102935554f453a5d68a60f27fe38a09b.tar.bz2
loc-dc0349df102935554f453a5d68a60f27fe38a09b.tar.xz
Add tests1
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to 'loc.c')
-rw-r--r--loc.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/loc.c b/loc.c
index 4434a19..3f58bc9 100644
--- a/loc.c
+++ b/loc.c
@@ -52,6 +52,7 @@ count(int fd, const char *fname)
ret += (ssize_t)!beginning;
beginning = 1;
escaped = 0;
+ continue;
} else if (escaped) {
escaped = 0;
} else if (buf[i] == quote) {
@@ -59,6 +60,7 @@ count(int fd, const char *fname)
} else if (buf[i] == '\\') {
escaped = 1;
}
+ beginning = 0;
} else if (c_comment) {
if (buf[i] == '\n') {
ret += (ssize_t)!beginning;