diff options
author | Mike Buland <eichlan@xagasoft.com> | 2007-12-18 18:10:28 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2007-12-18 18:10:28 +0000 |
commit | 1ea5bd399b081b598435e52854107bc506640a28 (patch) | |
tree | 3dfaf52eca2295fbb0f036ab26f2d51e3eac3548 /src/paramproc.cpp | |
parent | f557c2789239ae3c6334d8f60748a357cb9a20ac (diff) | |
download | libbu++-1ea5bd399b081b598435e52854107bc506640a28.tar.gz libbu++-1ea5bd399b081b598435e52854107bc506640a28.tar.bz2 libbu++-1ea5bd399b081b598435e52854107bc506640a28.tar.xz libbu++-1ea5bd399b081b598435e52854107bc506640a28.zip |
Corrected empty string comparrisons in Bu::ParamProc, it was checking for null
strings, which are no longer handed out in the Bu::FString, I think it's better
this way, but the Bu::ParamProc may need a little re-working to make it just
right (right now the default value of a string cannot be empty, doesn't sound
too bad...)
Diffstat (limited to '')
-rw-r--r-- | src/paramproc.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/paramproc.cpp b/src/paramproc.cpp index f016b78..d97821a 100644 --- a/src/paramproc.cpp +++ b/src/paramproc.cpp | |||
@@ -240,7 +240,7 @@ void Bu::ParamProc::process( int argc, char *argv[] ) | |||
240 | { | 240 | { |
241 | if( s->val.isSet() ) | 241 | if( s->val.isSet() ) |
242 | { | 242 | { |
243 | if( s->sValue.getStr() == NULL ) | 243 | if( s->sValue == "" ) |
244 | { | 244 | { |
245 | s->val = argv[arg]+s->sWord.getSize()+3; | 245 | s->val = argv[arg]+s->sWord.getSize()+3; |
246 | } | 246 | } |
@@ -268,7 +268,7 @@ void Bu::ParamProc::process( int argc, char *argv[] ) | |||
268 | int add = 0; | 268 | int add = 0; |
269 | if( s->val.isSet() ) | 269 | if( s->val.isSet() ) |
270 | { | 270 | { |
271 | if( s->sValue.getStr() == NULL ) | 271 | if( s->sValue == "" ) |
272 | { | 272 | { |
273 | if( arg+1 >= argc ) | 273 | if( arg+1 >= argc ) |
274 | { | 274 | { |
@@ -314,7 +314,7 @@ void Bu::ParamProc::process( int argc, char *argv[] ) | |||
314 | bool bUsed = false; | 314 | bool bUsed = false; |
315 | if( s->val.isSet() ) | 315 | if( s->val.isSet() ) |
316 | { | 316 | { |
317 | if( s->sValue.getStr() == NULL ) | 317 | if( s->sValue == "" ) |
318 | { | 318 | { |
319 | s->val = argv[arg]+chr+1; | 319 | s->val = argv[arg]+chr+1; |
320 | bUsed = true; | 320 | bUsed = true; |
@@ -349,7 +349,7 @@ void Bu::ParamProc::process( int argc, char *argv[] ) | |||
349 | bool bUsed = false; | 349 | bool bUsed = false; |
350 | if( s->val.isSet() ) | 350 | if( s->val.isSet() ) |
351 | { | 351 | { |
352 | if( s->sValue.getStr() == NULL ) | 352 | if( s->sValue == "" ) |
353 | { | 353 | { |
354 | s->val = argv[arg+1]; | 354 | s->val = argv[arg+1]; |
355 | bUsed = true; | 355 | bUsed = true; |
@@ -397,7 +397,7 @@ Bu::ParamProc::ArgSpec *Bu::ParamProc::checkWord( const char *arg ) | |||
397 | std::list<ArgSpec *>::const_iterator i; | 397 | std::list<ArgSpec *>::const_iterator i; |
398 | for( i = lArg.begin(); i != lArg.end(); i++ ) | 398 | for( i = lArg.begin(); i != lArg.end(); i++ ) |
399 | { | 399 | { |
400 | if( (*i)->sWord.getStr() == NULL ) | 400 | if( (*i)->sWord == "" ) |
401 | continue; | 401 | continue; |
402 | 402 | ||
403 | if( !strcmp( (*i)->sWord.getStr(), arg ) ) | 403 | if( !strcmp( (*i)->sWord.getStr(), arg ) ) |