From 7e798dd739883c1f47216578ba8df34dced24777 Mon Sep 17 00:00:00 2001 From: Arch Librarian Date: Mon, 20 Sep 2004 16:51:03 +0000 Subject: Sync Author: jgg Date: 1998-10-08 04:54:58 GMT Sync --- apt-pkg/contrib/cmndline.cc | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'apt-pkg/contrib/cmndline.cc') 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 =.",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 =.",argv[I]); + Conf->Set(string(Argument,J-Argument),string(argv[I++ +1])); + } + else + Conf->Set(string(Argument,J-Argument),string(J+1)); return true; } -- cgit v1.2.3