git: 689b33b101 - main - ports.cgi: less perl warnings

From: Wolfram Schneider <wosch_at_FreeBSD.org>
Date: Tue, 20 Jan 2026 20:47:36 UTC
The branch main has been updated by wosch:

URL: https://cgit.FreeBSD.org/doc/commit/?id=689b33b10128b53ffdc1ed16815d5ce9e08f8b7a

commit 689b33b10128b53ffdc1ed16815d5ce9e08f8b7a
Author:     Wolfram Schneider <wosch@FreeBSD.org>
AuthorDate: 2026-01-20 20:47:31 +0000
Commit:     Wolfram Schneider <wosch@FreeBSD.org>
CommitDate: 2026-01-20 20:47:31 +0000

    ports.cgi: less perl warnings
---
 website/content/en/cgi/ports.cgi | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/website/content/en/cgi/ports.cgi b/website/content/en/cgi/ports.cgi
index 28ac84bca2..5c1084cc90 100755
--- a/website/content/en/cgi/ports.cgi
+++ b/website/content/en/cgi/ports.cgi
@@ -556,22 +556,20 @@ EOF
 
 &init_variables;
 $query_string = &env('QUERY_STRING');
-$path_info    = &env('PATH_INFO');
+$path_info    = &env('PATH_INFO') // "";
 &decode_form( $query_string, *form );
 
 $section     = $form{'sektion'};
 $section     = 'all' if ( !$section );
-$query       = $form{'query'};
-$stype       = $form{'stype'};
+$query       = $form{'query'}    // "";
+$stype       = $form{'stype'}    // "";
 $sourceid    = $form{'sourceid'} // "";
 $script_name = &env('SCRIPT_NAME');
 $max         = $form{'max'} // $max_hits_default;
 
 if ( $path_info eq "/source" ) {
-
-    # XXX
     print "Content-type: text/plain\n\n";
-    open( R, $0 ) || do { print "ick!\n"; &exit; };
+    open( R, $0 ) || do { warn "open $0: $!!\n"; &exit; };
     while (<R>) { print }
     close R;
     &exit;