diff options
author | Paul Bolle <pebolle@tiscali.nl> | 2019-05-06 11:01:04 +0200 |
---|---|---|
committer | Jeremy Cline <jcline@redhat.com> | 2019-05-06 10:26:25 -0400 |
commit | 926fa54ae13fabfe16919ad08d475865b1916ded (patch) | |
tree | 8393822b06df78f357dc58efb7556dc9e5d32d0a | |
parent | f27f73697ffc50725a59db6f1c36b489f9b3ec84 (diff) | |
download | kernel-926fa54ae13fabfe16919ad08d475865b1916ded.tar.gz kernel-926fa54ae13fabfe16919ad08d475865b1916ded.tar.xz kernel-926fa54ae13fabfe16919ad08d475865b1916ded.zip |
configs: correctly terminate loop
The switch_to_toplevel() function in process_configs.sh contains a buggy
loop. It tests whether $path is empty but should test whether $path
equals "/". (It repeatedly calls dirname on pwd's output, and since pwd
will return an absolute path this will, eventually, return "/" forever.)
So let's test for "/" here.
Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
-rwxr-xr-x | configs/process_configs.sh | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/configs/process_configs.sh b/configs/process_configs.sh index a2ec3acb0..846fe2e70 100755 --- a/configs/process_configs.sh +++ b/configs/process_configs.sh @@ -14,7 +14,7 @@ die() switch_to_toplevel() { path="$(pwd)" - while test -n "$path" + while test "$path" != "/" do test -e $path/MAINTAINERS && \ test -d $path/drivers && \ @@ -23,7 +23,7 @@ switch_to_toplevel() path="$(dirname $path)" done - test -n "$path" || die "Can't find toplevel" + test "$path" != "/" || die "Can't find toplevel" echo "$path" } |