Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r57808 - trunk/libs/program_options/example
From: s.ochsenknecht_at_[hidden]
Date: 2009-11-20 05:03:08


Author: s_ochsenknecht
Date: 2009-11-20 05:03:08 EST (Fri, 20 Nov 2009)
New Revision: 57808
URL: http://svn.boost.org/trac/boost/changeset/57808

Log:
correct usage of tokenizer, memory bug, Fixes #3525
Text files modified:
   trunk/libs/program_options/example/response_file.cpp | 5 +++--
   1 files changed, 3 insertions(+), 2 deletions(-)

Modified: trunk/libs/program_options/example/response_file.cpp
==============================================================================
--- trunk/libs/program_options/example/response_file.cpp (original)
+++ trunk/libs/program_options/example/response_file.cpp 2009-11-20 05:03:08 EST (Fri, 20 Nov 2009)
@@ -70,7 +70,8 @@
             ss << ifs.rdbuf();
             // Split the file content
             char_separator<char> sep(" \n\r");
- tokenizer<char_separator<char> > tok(ss.str(), sep);
+ string sstr = ss.str();
+ tokenizer<char_separator<char> > tok(sstr, sep);
             vector<string> args;
             copy(tok.begin(), tok.end(), back_inserter(args));
             // Parse the file and store the options
@@ -87,7 +88,7 @@
             cout << "Magic value: " << vm["magic"].as<int>() << "\n";
         }
     }
- catch(exception& e) {
+ catch (std::exception& e) {
         cout << e.what() << "\n";
     }
 }


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