about summary refs log tree commit diff
path: root/unscoop.c
diff options
context:
space:
mode:
Diffstat (limited to 'unscoop.c')
-rw-r--r--unscoop.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/unscoop.c b/unscoop.c
index 35e25a9..a290831 100644
--- a/unscoop.c
+++ b/unscoop.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2019  C. McEnroe <june@causal.agency>
+/* Copyright (C) 2019  June McEnroe <june@causal.agency>
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -533,6 +533,8 @@ int main(int argc, char *argv[]) {
 		}
 
 		for (ssize_t len; 0 < (len = getline(&line, &cap, file));) {
+			if (len >= 1 && line[len-1] == '\n') line[len-1] = '\0';
+			if (len >= 2 && line[len-2] == '\r') line[len-2] = '\0';
 			matchLine(format, regex, line);
 			sizeRead += len;
 			if (100 * sizeRead / sizeTotal != sizePercent) {