summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Mathew Inwood <mathewi@google.com> 2018-09-14 22:05:08 -0700
committer android-build-merger <android-build-merger@google.com> 2018-09-14 22:05:08 -0700
commitc73d03a53a7cea1cc575625115fb82de9ac1ac77 (patch)
treec108bb7555acf45c0d354bbd8289a5597c68ebfc
parentdfca0da00e802fdd7c30b6942ad0ebeb12049aee (diff)
parent57a4bae7c3c79449fcb271375c8e3474a329f716 (diff)
Merge "Don't fail if there are no comments." am: daabcae955
am: 57a4bae7c3 Change-Id: I6e672e4edbd4a0e06edd1414c792186f38e4ffa3
-rwxr-xr-xtools/hiddenapi/sort_api.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/hiddenapi/sort_api.sh b/tools/hiddenapi/sort_api.sh
index bdcc8076dde1..76a2f2d6eba1 100755
--- a/tools/hiddenapi/sort_api.sh
+++ b/tools/hiddenapi/sort_api.sh
@@ -12,8 +12,8 @@ readarray A < "$source_list"
# Sort
IFS=$'\n'
# Stash away comments
-C=( $(grep -E '^#' <<< "${A[*]}") )
-A=( $(grep -v -E '^#' <<< "${A[*]}") )
+C=( $(grep -E '^#' <<< "${A[*]}" || :) )
+A=( $(grep -v -E '^#' <<< "${A[*]}" || :) )
# Sort entries
A=( $(LC_COLLATE=C sort -f <<< "${A[*]}") )
A=( $(uniq <<< "${A[*]}") )