From b9e244dfc7a381907aa6cf55966647ec2e0c038f Mon Sep 17 00:00:00 2001 From: Mikhail Naganov Date: Fri, 11 Jun 2021 08:52:39 -0700 Subject: [PATCH] audio: Fix parsing of arguments in the APM config update script The regex for finding "-h[elp]" argument wasn't correct. As a result, a file name containing "-h" would match. Fix the regex by requiring that "-h" must appear at the beginning of the line. Test: h/i/audio/7.0/config/update_audio_policy_config.sh -h Test: h/i/audio/7.0/config/update_audio_policy_config.sh -help Test: h/i/audio/7.0/config/update_audio_policy_config.sh test-help.xml Change-Id: Ibdf191e95baacc8600daa8b2f19ddc8338f182eb --- audio/7.0/config/update_audio_policy_config.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/audio/7.0/config/update_audio_policy_config.sh b/audio/7.0/config/update_audio_policy_config.sh index 159fa35946..c475dd17f0 100755 --- a/audio/7.0/config/update_audio_policy_config.sh +++ b/audio/7.0/config/update_audio_policy_config.sh @@ -41,7 +41,7 @@ set -euo pipefail -if (echo "$@" | grep -qe -h); then +if (echo "$@" | grep -qe "^-h"); then echo "This script will update Audio Policy Manager config file" echo "to the format required by V7.0 XSD schema from a previous" echo "version."