diff options
author | Michael Vogt <michael.vogt@ubuntu.com> | 2011-07-15 09:45:33 +0200 |
---|---|---|
committer | Michael Vogt <michael.vogt@ubuntu.com> | 2011-07-15 09:45:33 +0200 |
commit | 1d08f27046533e36849a63c084f51809be484d8c (patch) | |
tree | 4efff5cb3ab69fc877569a715a00e4c96d027b58 /apt-pkg/contrib | |
parent | 118192bfd764d03af4cfcfc10eb9c38e7cc98721 (diff) | |
parent | db4351bee8204c5eb352bb5667d3fbd416685715 (diff) |
merged from lp:~donkult/apt/sid
Diffstat (limited to 'apt-pkg/contrib')
-rw-r--r-- | apt-pkg/contrib/configuration.cc | 15 | ||||
-rw-r--r-- | apt-pkg/contrib/configuration.h | 3 |
2 files changed, 16 insertions, 2 deletions
diff --git a/apt-pkg/contrib/configuration.cc b/apt-pkg/contrib/configuration.cc index cc7093fe2..0664e3704 100644 --- a/apt-pkg/contrib/configuration.cc +++ b/apt-pkg/contrib/configuration.cc @@ -318,6 +318,19 @@ void Configuration::CndSet(const char *Name,const string &Value) Itm->Value = Value; } /*}}}*/ +// Configuration::Set - Set an integer value /*{{{*/ +// --------------------------------------------------------------------- +/* */ +void Configuration::CndSet(const char *Name,int const Value) +{ + Item *Itm = Lookup(Name,true); + if (Itm == 0 || Itm->Value.empty() == false) + return; + char S[300]; + snprintf(S,sizeof(S),"%i",Value); + Itm->Value = S; +} + /*}}}*/ // Configuration::Set - Set a value /*{{{*/ // --------------------------------------------------------------------- /* */ @@ -332,7 +345,7 @@ void Configuration::Set(const char *Name,const string &Value) // Configuration::Set - Set an integer value /*{{{*/ // --------------------------------------------------------------------- /* */ -void Configuration::Set(const char *Name,int const &Value) +void Configuration::Set(const char *Name,int const Value) { Item *Itm = Lookup(Name,true); if (Itm == 0) diff --git a/apt-pkg/contrib/configuration.h b/apt-pkg/contrib/configuration.h index 71e5a0e47..3568ce815 100644 --- a/apt-pkg/contrib/configuration.h +++ b/apt-pkg/contrib/configuration.h @@ -82,8 +82,9 @@ class Configuration inline void Set(const string &Name,const string &Value) {Set(Name.c_str(),Value);}; void CndSet(const char *Name,const string &Value); + void CndSet(const char *Name,const int Value); void Set(const char *Name,const string &Value); - void Set(const char *Name,const int &Value); + void Set(const char *Name,const int Value); inline bool Exists(const string &Name) const {return Exists(Name.c_str());}; bool Exists(const char *Name) const; |