diff options
author | Luke Shumaker <lukeshu@sbcglobal.net> | 2016-09-13 02:06:11 -0400 |
---|---|---|
committer | Luke Shumaker <lukeshu@sbcglobal.net> | 2016-09-13 02:06:11 -0400 |
commit | eac068e40a4467707c255a799550caf4363c1d2b (patch) | |
tree | d5dfb11c29fa355fe3ded33486c4861872cf8c8d /tools/notsd-find-includes | |
parent | 7e9315c610d0bf290cbac06418e9f545a66f1435 (diff) |
tools/: pull changes from master
Diffstat (limited to 'tools/notsd-find-includes')
-rwxr-xr-x | tools/notsd-find-includes | 70 |
1 files changed, 35 insertions, 35 deletions
diff --git a/tools/notsd-find-includes b/tools/notsd-find-includes index 6dfb406fa3..494398b082 100755 --- a/tools/notsd-find-includes +++ b/tools/notsd-find-includes @@ -3,50 +3,50 @@ phase=phase0 phase0() { - phase=phase0 - local line="$1" - case "$line" in - '#include'*|'typedef '*';') - phase1 "$line" - ;; - *) - ;; - esac + phase=phase0 + local line="$1" + case "$line" in + '#include'*|'typedef '*';') + phase1 "$line" + ;; + *) + ;; + esac } phase1() { - phase=phase1 - local line="$1" - case "$line" in - '') - ;; - '#include'*) - ;; - 'typedef '*';') - ;; - *) - phase2 "$line" - ;; - esac + phase=phase1 + local line="$1" + case "$line" in + '') + ;; + '#include'*) + ;; + 'typedef '*';') + ;; + *) + phase2 "$line" + ;; + esac } phase2() { - phase=phase2 - local line="$1" - printf '%s\n' "$line" - cat + phase=phase2 + local line="$1" + printf '%s\n' "$line" + cat } main() { - current_file="$1" - set -o pipefail - { - IFS='' - while read -r line; do - "$phase" "$line" - IFS='' - done - } < "$current_file" | grep '^#include' | ifne printf '%s\n' "$current_file" + current_file="$1" + set -o pipefail + { + IFS='' + while read -r line; do + "$phase" "$line" + IFS='' + done + } < "$current_file" | grep '^#include' | ifne printf '%s\n' "$current_file" } main "$@" |