diff options
author | Christian Neukirchen <chneukirchen@gmail.com> | 2015-11-14 17:01:42 +0100 |
---|---|---|
committer | Christian Neukirchen <chneukirchen@gmail.com> | 2015-11-14 17:01:42 +0100 |
commit | d84345abd9fa967809c9f8d94371d44d7989bdde (patch) | |
tree | 00e61ba3fd450fe7129acf8e23f7eeb7cd3c6a99 | |
parent | c192827dc2c6163bdae3cc8642bea4c9bffc760a (diff) | |
download | arr-d84345abd9fa967809c9f8d94371d44d7989bdde.tar.gz arr-d84345abd9fa967809c9f8d94371d44d7989bdde.tar.xz arr-d84345abd9fa967809c9f8d94371d44d7989bdde.zip |
Don't strip delimiter on EOF
-rw-r--r-- | arr.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/arr.c b/arr.c index b489720..c1b9037 100644 --- a/arr.c +++ b/arr.c @@ -292,9 +292,11 @@ main(int argc, char *argv[]) { } else { exit(1); } + } else { + // strip delimiter + if (lines[i][read-1] == delim) + lines[i][read-1] = 0; } - if (lines[i][read-1] == delim) // strip delimiter - lines[i][read-1] = 0; } if (eof) break; |