Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

sh: Add test for exit status of for loop without items.

POSIX says the exit status of a for loop without any items shall be 0.
There are no exceptions if the exit status of the previous command was
not 0 or if the item list contains a command substitution with non-zero
exit status.

Obtained-from:  FreeBSD 226892
  • Loading branch information...
commit c7e5ca9174c054125469d531b6f5726b7d557e61 1 parent 15ea693
authored December 25, 2011

Showing 1 changed file with 4 additions and 0 deletions. Show diff stats Hide diff stats

  1. 4  tools/regression/bin/sh/builtins/for1.0
4  tools/regression/bin/sh/builtins/for1.0
... ...
@@ -0,0 +1,4 @@
  1
+# $FreeBSD: src/tools/regression/bin/sh/builtins/for1.0,v 1.1 2011/10/28 23:02:21 jilles Exp $
  2
+
  3
+false
  4
+for i in `false`; do exit 3; done

0 notes on commit c7e5ca9

Please sign in to comment.
Something went wrong with that request. Please try again.