git: 46666781f5 - main - man.cgi: enable shortcuts URLs with a dot + section

From: Wolfram Schneider <wosch_at_FreeBSD.org>
Date: Sun, 04 Oct 2026 17:32:24 UTC
The branch main has been updated by wosch:

URL: https://cgit.FreeBSD.org/doc/commit/?id=46666781f5b002b7640235a14fefaa48fb5c442b

commit 46666781f5b002b7640235a14fefaa48fb5c442b
Author:     Wolfram Schneider <wosch@FreeBSD.org>
AuthorDate: 2026-10-04 17:31:40 +0000
Commit:     Wolfram Schneider <wosch@FreeBSD.org>
CommitDate: 2026-10-04 17:31:40 +0000

    man.cgi: enable shortcuts URLs with a dot + section
    
    E.g. man.freebsd.org/socket.2
    
    This is equal to the existing shortcut man.freebsd.org/socket/2
    and similar to other manpage services (NetBSD, Debian etc.)
---
 website/content/en/cgi/man.cgi | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/website/content/en/cgi/man.cgi b/website/content/en/cgi/man.cgi
index eec27056ff..e725872b39 100755
--- a/website/content/en/cgi/man.cgi
+++ b/website/content/en/cgi/man.cgi
@@ -1688,12 +1688,19 @@ sub do_man {
     $format = 'html' if $no_pdf_output{$manpath} && $format =~ /^(ps|pdf)$/;
 
     local ($fform) = &dec($form);
-    if ( $fform =~ m%^([0-9a-zA-Z_\-\.:]+)$% ) {
-        return &man( $1, '' );
+
+    # /cgi/man.cgi/socket.2
+    if (    $fform =~ m%^([0-9a-zA-Z_\-\.:]+)\.([1-9n])$% ) {
+        return &man( $1, $2 );
     }
+    # /cgi/man.cgi/socket(2)
     elsif ( $fform =~ m%^([0-9a-zA-Z_\-\.:]+)\(([0-9a-zA-Z]+)\)$% ) {
         return &man( $1, $2 );
     }
+    # /cgi/man.cgi/socket
+    elsif ( $fform =~ m%^([0-9a-zA-Z_\-\.:]+)$% ) {
+        return &man( $1, '' );
+    }
 
     # download a man hierarchy as gzip'd tar file
     return &download if ( $apropos > 1 );