diff options
Diffstat (limited to 'ace/Get_Opt.cpp')
-rw-r--r-- | ace/Get_Opt.cpp | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/ace/Get_Opt.cpp b/ace/Get_Opt.cpp index 05e8431e43f..1681010c0fc 100644 --- a/ace/Get_Opt.cpp +++ b/ace/Get_Opt.cpp @@ -89,21 +89,22 @@ ACE_Get_Opt::operator () (void) if (this->nextchar_ == 0 || *this->nextchar_ == '\0') { // Update scanning pointer. - - if (this->optind >= this->argc_) - { - this->nextchar_ = ASYS_TEXT (""); - return EOF; - } - - // skip non-options and "--" - if ((*(this->nextchar_ = this->argv_[this->optind]) != '-') - || (this->nextchar_[1] != 0 && *++this->nextchar_ == '-')) - { + + if (this->optind >= this->argc_ + || *(this->nextchar_ = this->argv_[this->optind]) != '-') + { + this->nextchar_ = ASYS_TEXT (""); + return EOF; + } + + if (this->nextchar_[1] != 0 + && *++this->nextchar_ == '-') + { + // Found "--". ++this->optind; - this->nextchar_ = ASYS_TEXT (""); - return '?'; - } + this->nextchar_ = ASYS_TEXT (""); + return EOF; + } } // Option letter okay? |