aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--coreutils/cut.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/coreutils/cut.c b/coreutils/cut.c
index 1e9867858..e12c56732 100644
--- a/coreutils/cut.c
+++ b/coreutils/cut.c
@@ -228,7 +228,9 @@ static void cut_file(FILE *file, const char *delim, const char *odelim,
228 continue; 228 continue;
229 } 229 }
230 end = next + rr.rm_so; 230 end = next + rr.rm_so;
231 next += rr.rm_eo; 231 next += (rr.rm_eo ? rr.rm_eo : 1);
232 /* ^^^ advancing by at least 1 prevents infinite loops */
233 /* testcase: echo "no at sign" | cut -d'@*' -F 1- */
232 } else 234 } else
233#endif 235#endif
234 { 236 {