]> granicus.if.org Git - apache/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:35:19 +0000 (03:35 +0000)
committerWilliam A. Rowe Jr <wrowe@apache.org>
Sat, 29 Dec 2007 03:35:19 +0000 (03:35 +0000)
split off the current user's name from USERPROFILE envvar.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@607367 13f79535-47bb-0310-9956-ffa450edef68

build/installwinconf.awk

index f373a214fe84f433286b651ea25d430eabcb6e48..b33da6f208d3eac75beb56d2b861616936447ed6 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;
@@ -171,7 +179,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 );