summaryrefslogtreecommitdiff
path: root/apt-pkg/contrib/strutl.cc
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2009-07-30 17:34:48 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2009-07-30 17:34:48 +0200
commit55fb35e87a1ff550cbb3010c5a03064f0a2b10be (patch)
tree6ecb92eb145eefbb0c4a6dc6a869d9e21ba10b55 /apt-pkg/contrib/strutl.cc
parentadbce12126ccc58016af69d541bafad5c8bde631 (diff)
parentd5752e18bed18c706c93f5c43c61016c72132ede (diff)
merged from debian
Diffstat (limited to 'apt-pkg/contrib/strutl.cc')
-rw-r--r--apt-pkg/contrib/strutl.cc15
1 files changed, 13 insertions, 2 deletions
diff --git a/apt-pkg/contrib/strutl.cc b/apt-pkg/contrib/strutl.cc
index 3b7a67db0..a991b8988 100644
--- a/apt-pkg/contrib/strutl.cc
+++ b/apt-pkg/contrib/strutl.cc
@@ -387,6 +387,17 @@ string SubstVar(string Str,const struct SubstVar *Vars)
return Str;
}
/*}}}*/
+// OutputInDepth - return a string with separator multiplied with depth /*{{{*/
+// ---------------------------------------------------------------------
+/* Returns a string with the supplied separator depth + 1 times in it */
+std::string OutputInDepth(const unsigned long Depth, const char* Separator)
+{
+ std::string output = "";
+ for(unsigned long d=Depth+1; d > 0; d--)
+ output.append(Separator);
+ return output;
+}
+ /*}}}*/
// URItoFileName - Convert the uri into a unique file name /*{{{*/
// ---------------------------------------------------------------------
/* This converts a URI into a safe filename. It quotes all unsafe characters
@@ -1031,7 +1042,7 @@ void ioprintf(ostream &out,const char *format,...)
va_start(args,format);
// sprintf the description
- char S[400];
+ char S[4096];
vsnprintf(S,sizeof(S),format,args);
out << S;
}
@@ -1046,7 +1057,7 @@ void strprintf(string &out,const char *format,...)
va_start(args,format);
// sprintf the description
- char S[1024];
+ char S[4096];
vsnprintf(S,sizeof(S),format,args);
out = string(S);
}