Boost logo

Boost-Commit :

From: ghost_at_[hidden]
Date: 2008-02-20 09:55:26


Author: vladimir_prus
Date: 2008-02-20 09:55:25 EST (Wed, 20 Feb 2008)
New Revision: 43331
URL: http://svn.boost.org/trac/boost/changeset/43331

Log:
Merge from trunk:
Tolerate argc being zero.

Patch from C. K. Jester-Young.

Text files modified:
   branches/release/boost/program_options/detail/parsers.hpp | 2 +-
   branches/release/libs/program_options/src/cmdline.cpp | 4 ++--
   2 files changed, 3 insertions(+), 3 deletions(-)

Modified: branches/release/boost/program_options/detail/parsers.hpp
==============================================================================
--- branches/release/boost/program_options/detail/parsers.hpp (original)
+++ branches/release/boost/program_options/detail/parsers.hpp 2008-02-20 09:55:25 EST (Wed, 20 Feb 2008)
@@ -38,7 +38,7 @@
     : detail::cmdline(
         // Explicit template arguments are required by gcc 3.3.1
         // (at least mingw version), and do no harm on other compilers.
- to_internal(detail::make_vector<charT, charT**>(argv+1, argv+argc)))
+ to_internal(detail::make_vector<charT, charT**>(argv+1, argv+argc+!argc)))
     {}
 
     

Modified: branches/release/libs/program_options/src/cmdline.cpp
==============================================================================
--- branches/release/libs/program_options/src/cmdline.cpp (original)
+++ branches/release/libs/program_options/src/cmdline.cpp 2008-02-20 09:55:25 EST (Wed, 20 Feb 2008)
@@ -98,10 +98,10 @@
     {
 #if defined(BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS)
         vector<string> args;
- copy(argv+1, argv+argc, inserter(args, args.end()));
+ copy(argv+1, argv+argc+!argc, inserter(args, args.end()));
         init(args);
 #else
- init(vector<string>(argv+1, argv+argc));
+ init(vector<string>(argv+1, argv+argc+!argc));
 #endif
     }
 


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