summaryrefslogtreecommitdiff
path: root/apt-pkg/contrib/configuration.cc
diff options
context:
space:
mode:
authorDavid Kalnischkies <kalnischkies@gmail.com>2011-07-06 13:41:18 +0200
committerDavid Kalnischkies <kalnischkies@gmail.com>2011-07-06 13:41:18 +0200
commit78485ab210b815c21ce55cb0cecb834ba5158e18 (patch)
tree116fa523f26d87440a0b8cdc8a192f7047227c04 /apt-pkg/contrib/configuration.cc
parentb41929c0139d0658046fb4e4088a8de167705a99 (diff)
* apt-pkg/init.cc:
- use CndSet in pkgInitConfig (Closes: #629617)
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)