summaryrefslogtreecommitdiff
path: root/apt-pkg/contrib/configuration.cc
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2011-07-15 09:53:38 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2011-07-15 09:53:38 +0200
commit6db194289ece36e62cb8dab0aa178209b46c59f2 (patch)
tree6e1970919929dd3d2d03d343e4ec40ccad22ad66 /apt-pkg/contrib/configuration.cc
parent35555c1826da5df9f2c06a74f2e91be843ad8142 (diff)
parent1d08f27046533e36849a63c084f51809be484d8c (diff)
merged from http://bzr.debian.org/bzr/apt/apt/debian-sid
Diffstat (limited to 'apt-pkg/contrib/configuration.cc')
-rw-r--r--apt-pkg/contrib/configuration.cc15
1 files changed, 14 insertions, 1 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)