summaryrefslogtreecommitdiff
path: root/apt-pkg/contrib/cmndline.cc
diff options
context:
space:
mode:
authorArch Librarian <arch@canonical.com>2004-09-20 16:51:03 +0000
committerArch Librarian <arch@canonical.com>2004-09-20 16:51:03 +0000
commit7e798dd739883c1f47216578ba8df34dced24777 (patch)
treed756274fb10d7bb3a6b14306d46390139ce60da2 /apt-pkg/contrib/cmndline.cc
parent7e54a6d6f1d500a4e26dbe34952ff3af65d0b0b7 (diff)
Sync
Author: jgg Date: 1998-10-08 04:54:58 GMT Sync
Diffstat (limited to 'apt-pkg/contrib/cmndline.cc')
-rw-r--r--apt-pkg/contrib/cmndline.cc14
1 files changed, 11 insertions, 3 deletions
diff --git a/apt-pkg/contrib/cmndline.cc b/apt-pkg/contrib/cmndline.cc
index 8e25d395f..7f5ab59a5 100644
--- a/apt-pkg/contrib/cmndline.cc
+++ b/apt-pkg/contrib/cmndline.cc
@@ -1,6 +1,6 @@
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: cmndline.cc,v 1.2 1998/09/26 05:34:24 jgg Exp $
+// $Id: cmndline.cc,v 1.3 1998/10/08 04:55:01 jgg Exp $
/* ######################################################################
Command Line Class - Sophisticated command line parser
@@ -184,9 +184,17 @@ bool CommandLine::HandleOpt(int &I,int argc,const char *argv[],
const char *J;
for (J = Argument; *J != 0 && *J != '='; J++);
if (*J == 0)
- return _error->Error("Option %s: Configuration item sepecification must have an =.",argv[I]);
+ return _error->Error("Option %s: Configuration item sepecification must have an =<val>.",argv[I]);
- Conf->Set(string(Argument,J-Argument),string(J+1));
+ // = is trailing
+ if (J[1] == 0)
+ {
+ if (I+1 >= argc)
+ return _error->Error("Option %s: Configuration item sepecification must have an =<val>.",argv[I]);
+ Conf->Set(string(Argument,J-Argument),string(argv[I++ +1]));
+ }
+ else
+ Conf->Set(string(Argument,J-Argument),string(J+1));
return true;
}