summaryrefslogtreecommitdiff
path: root/apt-pkg/contrib/strutl.cc
diff options
context:
space:
mode:
authorArch Librarian <arch@canonical.com>2004-09-20 16:52:26 +0000
committerArch Librarian <arch@canonical.com>2004-09-20 16:52:26 +0000
commit7f25bdff3a0fa55ba897964d5c82475b45f3325a (patch)
tree7190f1448161be6bfd163cdd88efee6101e1ae8c /apt-pkg/contrib/strutl.cc
parenta9975068c7d55b2fbe46aacf94a36b460fd1d9da (diff)
Dsync merge
Author: jgg Date: 1999-01-18 06:20:07 GMT Dsync merge
Diffstat (limited to 'apt-pkg/contrib/strutl.cc')
-rw-r--r--apt-pkg/contrib/strutl.cc8
1 files changed, 5 insertions, 3 deletions
diff --git a/apt-pkg/contrib/strutl.cc b/apt-pkg/contrib/strutl.cc
index a05359f82..6a90b2b88 100644
--- a/apt-pkg/contrib/strutl.cc
+++ b/apt-pkg/contrib/strutl.cc
@@ -1,6 +1,6 @@
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: strutl.cc,v 1.16 1998/12/31 05:45:26 jgg Exp $
+// $Id: strutl.cc,v 1.17 1999/01/18 06:20:08 jgg Exp $
/* ######################################################################
String Util - Some usefull string functions.
@@ -189,7 +189,7 @@ string QuoteString(string Str,const char *Bad)
*I <= 0x20 || *I >= 0x7F)
{
char Buf[10];
- sprintf(Buf,"%%%02x",(unsigned int)((unsigned char)*I));
+ sprintf(Buf,"%%%02x",(int)*I);
Res += Buf;
}
else
@@ -214,7 +214,7 @@ string SizeToStr(double Size)
/* bytes, KiloBytes, MegaBytes, GigaBytes, TeraBytes, PetaBytes,
ExaBytes, ZettaBytes, YottaBytes */
- char Ext[] = {'b','k','M','G','T','P','E','Z','Y'};
+ char Ext[] = {'\0','k','M','G','T','P','E','Z','Y'};
int I = 0;
while (I <= 8)
{
@@ -456,6 +456,7 @@ int StringToBool(string Text,int Default = -1)
if (strcasecmp(Text.c_str(),"no") == 0 ||
strcasecmp(Text.c_str(),"false") == 0 ||
strcasecmp(Text.c_str(),"without") == 0 ||
+ strcasecmp(Text.c_str(),"off") == 0 ||
strcasecmp(Text.c_str(),"disable") == 0)
return 0;
@@ -463,6 +464,7 @@ int StringToBool(string Text,int Default = -1)
if (strcasecmp(Text.c_str(),"yes") == 0 ||
strcasecmp(Text.c_str(),"true") == 0 ||
strcasecmp(Text.c_str(),"with") == 0 ||
+ strcasecmp(Text.c_str(),"on") == 0 ||
strcasecmp(Text.c_str(),"enable") == 0)
return 1;