git: 5d176928a7 - main - ports.cgi: fix packages links for categories that contain a dash

Wolfram Schneider <[email protected]>
Newsgroups gmane.os.freebsd.devel.cvs.doc
Message-ID <[email protected]>
The branch main has been updated by wosch:

URL: https://cgit.FreeBSD.org/doc/commit/?id=5d176928a765e58f3a2d7de605ebaaaaa751445f

commit 5d176928a765e58f3a2d7de605ebaaaaa751445f
Author:     Wolfram Schneider <[email protected]>
AuthorDate: 2026-03-31 19:32:49 +0000
Commit:     Wolfram Schneider <[email protected]>
CommitDate: 2026-03-31 19:32:49 +0000

    ports.cgi: fix packages links for categories that contain a dash
    
    PR: 293721
---
 website/content/en/cgi/ports.cgi | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/website/content/en/cgi/ports.cgi b/website/content/en/cgi/ports.cgi
index c036f4665a..d4f1c6bbc0 100755
--- a/website/content/en/cgi/ports.cgi
+++ b/website/content/en/cgi/ports.cgi
@@ -878,14 +878,14 @@ $counter = 0;
 $query =~ s/^\^// if $stype eq 'requires';
 
 # quote non characters
+my $query2 = $query;
 $query =~ s/([^\w\^])/\\$1/g;
 
 # search
 if ($query) {
     my $q = "";
-    if ( $query =~ m,^([A-Za-z0-9\-]+)(\\/)([A-Za-z0-9\-_\+\.\\]+)$, ) {
-        $q = "$1$2$3";
-        $q =~ s,\\,,g;
+    if ( $query2 =~ m,^([A-Za-z0-9\-]+)/([A-Za-z0-9\-_\+\.\\]+)$, ) {
+        $q = "$1/$2";
     }
 
     if ( $q ne "" && $enable_packages_link && $stype eq 'pkg' ) {
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.