]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/Config.pm
lei q --save: clobber config file on repeats
[public-inbox.git] / lib / PublicInbox / Config.pm
index 26ac298eddb86f2256c4618d7abef920f7a4b95d..603dad983657441a68694bb7cc2bb19156794232 100644 (file)
@@ -559,4 +559,13 @@ sub json {
        };
 }
 
+sub squote_maybe ($) {
+       my ($val) = @_;
+       if ($val =~ m{([^\w@\./,\%\+\-])}) {
+               $val =~ s/(['!])/'\\$1'/g; # '!' for csh
+               return "'$val'";
+       }
+       $val;
+}
+
 1;