[pacman-dev] [PATCH 4/6] bacman: use globbing in place of regex

lolilolicon lolilolicon at gmail.com
Thu Sep 29 13:14:04 EDT 2011


The original regex is also not accurate (should be ^[A-Z]+$).

Signed-off-by: lolilolicon <lolilolicon at gmail.com>
---
 contrib/bacman.in |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/contrib/bacman.in b/contrib/bacman.in
index d43bf78..c69ab6f 100755
--- a/contrib/bacman.in
+++ b/contrib/bacman.in
@@ -143,7 +143,7 @@ while read i; do
         continue
     fi
 
-    if [[ "$i" =~ %[A-Z]*% ]] ; then
+    if [[ "$i" == %+([A-Z])% ]] ; then
         current=$i
         continue
     fi
@@ -199,7 +199,7 @@ while read i; do
         continue;
     fi
 
-    if [[ "$i" =~ %[A-Z]*% ]] ; then
+    if [[ "$i" == %+([A-Z])% ]] ; then
         current=$i
         continue
     fi
-- 
1.7.6.4



More information about the pacman-dev mailing list