From 93914c7b1262cff6e933cb66c8392d81e168b196 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Sat, 17 Nov 2007 10:04:07 +0100 Subject: Correct preceding patch. * src/seq.c (print_numbers): Also handle first < last && step < 0. * tests/misc/seq [empty-rev]: New test for this case. --- src/seq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/seq.c b/src/seq.c index 77d558697..eec5ed554 100644 --- a/src/seq.c +++ b/src/seq.c @@ -285,7 +285,7 @@ print_numbers (char const *fmt, struct layout layout, Hence the first conjunct: don't break out of this loop when i == 0. *unless* first and last themselves are out of order, in which case we must print nothing, e.g. for ./seq -1 */ - if (i || last < first) + if (i || (0 < step && last < first) || (step < 0 && first < last)) break; } -- cgit v1.2.3-54-g00ecf