diff options
author | schmidt <douglascraigschmidt@users.noreply.github.com> | 1999-03-12 04:33:04 +0000 |
---|---|---|
committer | schmidt <douglascraigschmidt@users.noreply.github.com> | 1999-03-12 04:33:04 +0000 |
commit | 454abbad320a177b89891abb4296def9f5c5e9ff (patch) | |
tree | fb93965c1e52748f8a9b35f3ea05a6e4a808cfeb | |
parent | 175f2fc589878edb80f6d385329451916518ad69 (diff) | |
download | ATCD-454abbad320a177b89891abb4296def9f5c5e9ff.tar.gz |
.
-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? |