]> Sergey Matveev's repositories - nnn.git/commitdiff
plugins/chksum: use exit instead of return
authorNRK <nrk@disroot.org>
Wed, 25 Jan 2023 19:07:08 +0000 (01:07 +0600)
committerNRK <nrk@disroot.org>
Wed, 25 Jan 2023 19:21:40 +0000 (01:21 +0600)
From https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_24:

| The return utility shall cause the shell to stop executing the current
| function or dot script. If the shell is not currently executing a
| function or dot script, the results are unspecified.

Closes: https://github.com/jarun/nnn/issues/1572
plugins/chksum

index 5fa91cbf8df1d31fc51e88359db15f569cd8b203..9441cc1813a04d8f743d910a2f39a6658fa6fe3a 100755 (executable)
@@ -61,7 +61,7 @@ elif [ -n "$1" ]; then
             if echo "$1" | grep -q \.${chks}$; then
                 ${chks}sum -c < "$1"
                 read -r _
-                return
+                exit
             fi
         done
         checksum_type