Boost logo

Boost-Commit :

From: jurko.gospodnetic_at_[hidden]
Date: 2008-07-31 13:41:41


Author: jurko
Date: 2008-07-31 13:41:40 EDT (Thu, 31 Jul 2008)
New Revision: 47913
URL: http://svn.boost.org/trac/boost/changeset/47913

Log:
Added Boost Jam support for executing command lines longer than 2047 characters (up to 8191) characters when running on Windows XP or later OS version. Patch contributed by Franz Schnyder.

See http://support.microsoft.com/default.aspx?scid=kb;en-us;830473 for more detailed information on Windows cmd.exe shell command-line length limitations.
Text files modified:
   trunk/tools/jam/src/execnt.c | 12 ++++++++----
   1 files changed, 8 insertions(+), 4 deletions(-)

Modified: trunk/tools/jam/src/execnt.c
==============================================================================
--- trunk/tools/jam/src/execnt.c (original)
+++ trunk/tools/jam/src/execnt.c 2008-07-31 13:41:40 EDT (Thu, 31 Jul 2008)
@@ -564,16 +564,20 @@
     BJAM_FREE( args );
 }
 
+/* For more details on Windows cmd.exe shell command-line length limitations see
+ * the following MSDN article:
+ *
+ * http://support.microsoft.com/default.aspx?scid=kb;en-us;830473
+ */
 int maxline()
 {
     OSVERSIONINFO os_info;
     os_info.dwOSVersionInfoSize = sizeof(os_info);
     GetVersionEx(&os_info);
     
- return (os_info.dwMajorVersion == 3)
- ? 996 /* NT 3.5.1 */
- : 2047 /* NT >= 4.x */
- ;
+ if (os_info.dwMajorVersion >= 5) return 8191; /* XP > */
+ if (os_info.dwMajorVersion == 4) return 2047; /* NT 4.x */
+ return 996; /* NT 3.5.1 */
 }
 
 /* Convert a command string into arguments for spawnvp. The original


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk