--- TWiki.pm.orig	Tue Mar  2 07:15:21 2004
+++ TWiki.pm	Tue Mar  2 07:14:51 2004
@@ -322,7 +322,9 @@
     # invalid PATH_INFO is often a full path starting with '/cgi-bin/...'.
     ## DEBUG: Simulate broken path_info
     ## $thePathInfo = "$scriptUrlPath/view/Main/WebStatistics";
-    $thePathInfo =~ s!$scriptUrlPath/[\-\.A-Z]+$scriptSuffix/!/!i;
+    if( $scriptUrlPath ) {
+        $thePathInfo =~ s!$scriptUrlPath/[\-\.A-Z]+$scriptSuffix/!/!i;
+    }
     ##writeDebug( "===== thePathInfo after cleanup = $thePathInfo" );
 
     # Get the web and topic names from PATH_INFO
 
