diff options
| author | brian m. carlson <sandals@crustytoothpaste.net> | 2024-10-23 00:46:00 +0000 |
|---|---|---|
| committer | Taylor Blau <me@ttaylorr.com> | 2024-10-23 16:16:36 -0400 |
| commit | 5f139a194f22b34eb49a891253271693989d6fdc (patch) | |
| tree | ac1e79c19a7733e3c22daf21a956f194c82b886a /gitweb/gitweb.perl | |
| parent | Require Perl 5.26.0 (diff) | |
| download | git-5f139a194f22b34eb49a891253271693989d6fdc.tar.gz git-5f139a194f22b34eb49a891253271693989d6fdc.zip | |
gitweb: make use of s///r
In Perl 5.14, released in May 2011, the r modifier was added to the s///
operator to allow it to return the modified string instead of modifying
the string in place. This allows to write nicer, more succinct code in
several cases, so let's do that here.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
Diffstat (limited to 'gitweb/gitweb.perl')
| -rwxr-xr-x | gitweb/gitweb.perl | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl index da1486cab2..c4e0008d59 100755 --- a/gitweb/gitweb.perl +++ b/gitweb/gitweb.perl @@ -1188,7 +1188,7 @@ sub evaluate_and_validate_params { if ($search_use_regexp) { $search_regexp = $searchtext; if (!eval { qr/$search_regexp/; 1; }) { - (my $error = $@) =~ s/ at \S+ line \d+.*\n?//; + my $error = $@ =~ s/ at \S+ line \d+.*\n?//r; die_error(400, "Invalid search regexp '$search_regexp'", esc_html($error)); } @@ -2700,7 +2700,7 @@ sub git_cmd { # Try to avoid using this function wherever possible. sub quote_command { return join(' ', - map { my $a = $_; $a =~ s/(['!])/'\\$1'/g; "'$a'" } @_ ); + map { my $a = $_ =~ s/(['!])/'\\$1'/gr; "'$a'" } @_ ); } # get HEAD ref of given project as hash |
