summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorJustin Davis <jrcd83@gmail.com>2012-05-25 19:20:13 +0200
committerJustin Davis <jrcd83@gmail.com>2012-05-25 19:20:13 +0200
commit2157e2ea0594d5f1b3202b7326adb1835060f24d (patch)
tree72248bb9eae169ea3dcfee34ac3127bf6783d5f3 /bin
parent9eef9ba8699f0322206d86d58c1a35fc449be7ff (diff)
downloadgenpkg-2157e2ea0594d5f1b3202b7326adb1835060f24d.tar.gz
genpkg-2157e2ea0594d5f1b3202b7326adb1835060f24d.tar.xz
Prefer single quoting to double quoting strings.
Diffstat (limited to 'bin')
-rwxr-xr-xbin/pbfields9
1 files changed, 5 insertions, 4 deletions
diff --git a/bin/pbfields b/bin/pbfields
index a06bf0b..310a375 100755
--- a/bin/pbfields
+++ b/bin/pbfields
@@ -118,11 +118,12 @@ function quotevals ()
function bashquote (val)
{
-
- if(val ~ /[$'"`]/){
+ if(val ~ /'/){
gsub(/[$"`]/, "\\\\&", val)
return sprintf("\"%s\"", val)
+ }else if(val ~ /[ <>`$"]/){
+ return sprintf("'%s'", val)
+ }else{
+ return val
}
- if(val ~ /[ <>]/) return sprintf("'%s'", val)
- return val
}