You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by fu...@apache.org on 2012/09/29 10:29:20 UTC

svn commit: r1391772 - /httpd/httpd/trunk/docs/cgi-examples/printenv.vbs

Author: fuankg
Date: Sat Sep 29 08:29:20 2012
New Revision: 1391772

URL: http://svn.apache.org/viewvc?rev=1391772&view=rev
Log:
Changed WScript.Echo to WScript.StdOut.WriteLine because
WScript.Echo seems to mess up output with Locale;
avoid Split() usage since it seems not consistent with
all versions.

Modified:
    httpd/httpd/trunk/docs/cgi-examples/printenv.vbs

Modified: httpd/httpd/trunk/docs/cgi-examples/printenv.vbs
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/docs/cgi-examples/printenv.vbs?rev=1391772&r1=1391771&r2=1391772&view=diff
==============================================================================
--- httpd/httpd/trunk/docs/cgi-examples/printenv.vbs (original)
+++ httpd/httpd/trunk/docs/cgi-examples/printenv.vbs Sat Sep 29 08:29:20 2012
@@ -12,21 +12,18 @@
 ''
 Option Explicit
 
-Dim objShell, objArray, str, env
+Dim objShell, objArray, str, envvar, envval
 Set objShell = CreateObject("WScript.Shell")
 Set objArray = CreateObject("System.Collections.ArrayList")
 
-Wscript.Echo "Content-type: text/plain; charset=iso-8859-1" & vbLF
+WScript.StdOut.WriteLine "Content-type: text/plain; charset=iso-8859-1" & vbLF
 For Each str In objShell.Environment("PROCESS")
-  env = Split(str, "=", 2)
-  env(1) = Replace(env(1), vbLF, "\n")
-  objArray.Add env(0) & "=" & Chr(34) & env(1) & Chr(34)
+  objArray.Add str
 Next
 objArray.Sort()
 For Each str In objArray
-  WScript.Echo str
+  envvar = Left(str, InStr(str, "="))
+  envval = Replace(Mid(str, InStr(str, "=") + 1), vbLF, "\n")
+  WScript.StdOut.WriteLine envvar & Chr(34) & envval & Chr(34)
 Next
 
-'WScript.Echo ScriptEngine & " Version=" & ScriptEngineMajorVersion & "." & _
-'             ScriptEngineMinorVersion & "." & ScriptEngineBuildVersion
-