]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Believe this or not, not every machine uses "C:\Documents and Settings",
authorWilliam A. Rowe Jr <wrowe@apache.org>
Sat, 29 Dec 2007 03:36:20 +0000 (03:36 +0000)
committerWilliam A. Rowe Jr <wrowe@apache.org>
Sat, 29 Dec 2007 03:36:20 +0000 (03:36 +0000)
split off the current user's name from USERPROFILE envvar.

Backport: r607367

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@607368 13f79535-47bb-0310-9956-ffa450edef68

build/installwinconf.awk

index 991c7dcb87d8345a4871b2628e356099c6f72fc5..bc2540f5392caf5bc771adcc60525b0e8d28a717 100644 (file)
@@ -38,6 +38,14 @@ BEGIN {
         sourceroot = serverroot "/" sourceroot;
     }
 
+    usertree = ENVIRON["USERPROFILE"]
+    if ( usertree > "" ) {
+        gsub( /\\/, "/", usertree );
+        gsub( /\/[^\/]+$/, "", usertree );
+    } else {
+        usertree = "C:/Documents and Settings";
+    }
+
     print "Installing Apache HTTP 2.0 server with" >tstfl;
     print " DomainName =    " domainname >tstfl;
     print " ServerName =    " servername >tstfl;
@@ -167,7 +175,8 @@ BEGIN {
        }
        gsub( /@rel_runtimedir@/, "logs" );
        gsub( /@rel_sysconfdir@/, "conf" );
-       gsub( /\/home\/\*\/public_html/, "\"C:/Documents and Settings/*/My Documents/My Website\"" );
+       gsub( /\/home\/\*\/public_html/, \
+              usertree "/*/My Documents/My Website" );
        gsub( /UserDir public_html/, "UserDir \"My Documents/My Website\"" );
        gsub( /@@ServerName@@|www.example.com/,  servername );
         gsub( /@@ServerAdmin@@|you@example.com/, serveradmin );