summaryrefslogtreecommitdiff
path: root/apt-pkg/contrib/strutl.cc
AgeCommit message (Collapse)Author
2014-09-07strip everything spacey in APT::String::StripDavid Kalnischkies
Git-Dch: Ignore
2014-07-16StringToBool: only act if the entire string is consumed by strtol()Michael Vogt
StringToBool uses strtol() internally to check if the argument is a number. This function stops when it does not find any more numbers. So a string like "0ad" (which is a valid packagename) is interpreted as a "0". The code now checks that the entire string is consumed not just a part of it. Thanks to Johannes Schauer for raising this issue.
2014-06-18fix SubstVar to be usable as a replace_all methodDavid Kalnischkies
The name suggests that it is supposed to substitute a variable with a value, but we tend to use it in a more liberal replace_all() fashion, but this breaks if either of the parameters is empty or more importantly if two "variable" occurrences follow each other directly.
2014-03-13cleanup headers and especially #includes everywhereDavid Kalnischkies
Beside being a bit cleaner it hopefully also resolves oddball problems I have with high levels of parallel jobs. Git-Dch: Ignore Reported-By: iwyu (include-what-you-use)
2014-03-13warning: cannot optimize loop, the loop counter may overflow ↵David Kalnischkies
[-Wunsafe-loop-optimizations] Git-Dch: Ignore Reported-By: gcc -Wunsafe-loop-optimizations
2014-03-13warning: extra ‘;’ [-Wpedantic]David Kalnischkies
Git-Dch: Ignore Reported-By: gcc -Wpedantic
2014-03-13add default and override handling for Cnf::FindVectorDavid Kalnischkies
Automatically handle the override of list options via its parent value which can even be a comma-separated list of values. It also adds an easy way of providing a default for the list.
2014-02-22Fix typos in documentation (codespell)Michael Vogt
2013-11-29add "APT::String::Endswith" and automatic adding of ".list" in apt edit-sourceMichael Vogt
2013-10-18re-add missing APT::String::StripMichael Vogt
2013-10-01change maxsplit default from "0" to maxintMichael Vogt
2013-10-01improve documentation for StringSplit()Michael Vogt
2013-09-07doc updateMichael Vogt
2013-09-07add maxsplit parameter to StringSplitMichael Vogt
2013-09-07implement StringSplit() as we need this to fix the dpkg status-fd output parsingMichael Vogt
2013-08-22Merge remote-tracking branch 'mvo/bugfix/coverity' into debian/sidMichael Vogt
Conflicts: apt-pkg/tagfile.h
2013-08-12squash merge of the feature/apt-binary branch without the changes from ↵Michael Vogt
experimental
2013-08-12some more coverity fixesMichael Vogt
2013-07-26fix another missing va_end()Michael Vogt
2013-06-20support \n and \r\n line endings in ReadMessagesDavid Kalnischkies
2013-05-08merged patch from Daniel Hartwig to fix URI and proxy releated issuesMichael Vogt
2013-04-08merged bundle from davidMichael Vogt
2013-03-15split out a method to strip whitespaces only on the right sideMichael Vogt
2013-03-10various simple changes to fix cppcheck warningsDavid Kalnischkies
2012-04-21* apt-pkg/contrib/strutl.cc:David Kalnischkies
- remove the message size limit from ioprintf and strprintf
2012-03-05as we parse datestrings from external sources a lot specify the lengthDavid Kalnischkies
of the integer fields as well to avoid crashes in scanf as cppchecks warns: "(warning) scanf without field width limits can crash with huge input data"
2011-10-30merge with my debian-sid branchDavid Kalnischkies
2011-09-21convert a few for-loop char finds to proper strchr and memchrDavid Kalnischkies
2011-09-13merge with debian/experimentalDavid Kalnischkies
2011-09-13Support large files in the complete toolset. Indexes of thisDavid Kalnischkies
size are pretty unlikely for now, but we need it for deb packages which could become bigger than 4GB now (LP: #815895)
2011-09-13reorder includes: add <config.h> if needed and include it at firstDavid Kalnischkies
2011-08-11cppcheck complains about some possible speed improvements which could beDavid Kalnischkies
done on the mirco-optimazation level, so lets fix them: (performance) Possible inefficient checking for emptiness. (performance) Prefer prefix ++/-- operators for non-primitive types.
2011-07-26fix typos in changelog, make DeEscapeString const, improve descriptionMichael Vogt
2011-07-26add another escape test case, fixup octal one (its \0XX instead of \0XXX)Michael Vogt
2011-07-26apt-pkg/contrib/strutl.cc: kill unneeded debug outputMichael Vogt
2011-07-26* apt-pkg/contrib/strutl.{h,cc}, test/libapt/strutil_test.cc:Michael Vogt
- add new DeEscapeString() similar to DeQuoteQuotedWord but unescape charackter escapes like \0XXX and \xXX (plus add test)
2011-04-02let TimeRFC1123 return an empty string if gmtime() failsDavid Kalnischkies
2011-04-02impossible to be too long but just to be sure use snprintfDavid Kalnischkies
2011-02-03merge 'after squeeze release'-stuffDavid Kalnischkies
[ David Kalnischkies ] * apt-pkg/depcache.cc: - add SetCandidateRelease() to set a candidate version and the candidates of dependencies if needed to a specified release (Closes: #572709) * cmdline/apt-get.cc: - if --print-uris is used don't setup downloader as we don't need progress, lock nor the directories it would create otherwise - show dependencies of essential packages which are going to remove only if they cause the remove of this essential (Closes: #601961) - keep not installed garbage packages uninstalled instead of showing in the autoremove section and installing those (Closes: #604222) - change pkg/release behavior to use the new SetCandidateRelease so installing packages from experimental or backports is easier - really do not show packages in the extra section if they were requested on the commandline, e.g. with a modifier (Closes: #184730) * debian/control: - add Vcs-Browser now that loggerhead works again (Closes: #511168) - depend on debhelper 7 to raise compat level - depend on dpkg-dev (>= 1.15.8) to have c++ symbol mangling * apt-pkg/contrib/fileutl.cc: - add a RealFileExists method and check that your configuration files are real files to avoid endless loops if not (Closes: #604401) - ignore non-regular files in GetListOfFilesInDir (Closes: #594694) * apt-pkg/contrib/weakptr.h: - include stddefs.h to fix compile error (undefined NULL) with gcc-4.6 * methods/https.cc: - fix CURLOPT_SSL_VERIFYHOST by really passing 2 to it if enabled * deb/dpkgpm.cc: - fix popen/fclose mismatch reported by cppcheck. Thanks to Petter Reinholdtsen for report and patch! (Closes: #607803) * doc/apt.conf.5.xml: - fix multipl{y,e} spelling error reported by Jakub Wilk (Closes: #607636) * apt-inst/contrib/extracttar.cc: - let apt-utils work with encoded tar headers if uid/gid are large. Thanks to Nobuhiro Hayashi for the patch! (Closes: #330162) * apt-pkg/cacheiterator.h: - do not segfault if cache is not build (Closes: #254770) * doc/apt-get.8.xml: - remove duplicated mentioning of --install-recommends * doc/sources.list.5.xml: - remove obsolete references to non-us (Closes: #594495) * debian/rules: - use -- instead of deprecated -u for dh_gencontrol - remove shlibs.local creation and usage - show differences in the symbol files, but never fail * pre-build.sh: - remove as it is not needed for a working 'bzr bd' * debian/{apt,apt-utils}.symbols: - ship experimental unmangled c++ symbol files * methods/rred.cc: - operate optional on gzip compressed pdiffs * apt-pkg/acquire-item.cc: - don't uncompress downloaded pdiff files before feeding it to rred - try downloading clearsigned InRelease before trying Release.gpg - change the internal handling of Extensions in pkgAcqIndex - add a special uncompressed compression type to prefer those files - download and use i18n/Index to choose which Translations to download * cmdline/apt-key: - don't set trustdb-name as non-root so 'list' and 'finger' can be used without being root (Closes: #393005, #592107) * apt-pkg/deb/deblistparser.cc: - rewrite LoadReleaseInfo to cope with clearsigned Releasefiles * ftparchive/writer.cc: - add config option to search for more patterns in release command - include Index files by default in the Release file * methods/{gzip,bzip}.cc: - print a good error message if FileSize() is zero * apt-pkg/aptconfiguration.cc: - remove the inbuilt Translation files whitelist
2011-01-13* apt-inst/contrib/extracttar.cc:David Kalnischkies
- let apt-utils work with encoded tar headers if uid/gid are large. Thanks to Nobuhiro Hayashi for the patch! (Closes: #330162)
2010-12-03Permit base256 encoded value in the numeric field of tar header.Nobuhiro Hayashi
2010-11-16add support for third party changelogsMichael Vogt
2010-09-28* apt-pkg/contrib/strutl.cc:David Kalnischkies
- add a space between number and unit as required by SI (Closes: #598352)
2010-08-16* apt-pkg/contrib/strutl.cc:David Kalnischkies
- fix error checking for vsnprintf in its safe variant Spotted by -Wextra: contrib/strutl.cc: In function 'char* safe_snprintf(char*, char*, const char*, ...)': contrib/strutl.cc:1172:14: warning: comparison of unsigned expression < 0 is always false
2010-06-09be sure that the RFC1123StrToTime method is run in a LANG=C environmentDavid Kalnischkies
2010-06-09use the portable timegm shown in his manpage instead of a strangeDavid Kalnischkies
looking code copycat from wget
2010-06-08* apt-pkg/contrib/strutl.cc:David Kalnischkies
- split StrToTime() into HTTP1.1 and FTP date parser methods and use strptime() instead of some selfmade scanf mangling
2010-03-31Userinfo is urlencoded in URIs (RFC 3986)David Kalnischkies
Thanks to Jean-Baptiste Lallement for spotting and fixing it! * apt-pkg/contrib/strutl.cc: - always escape '%' (LP: #130289) (Closes: #500560) - unescape '%' sequence only if followed by 2 hex digit - username/password are urlencoded in proxy string (RFC 3986)
2010-03-30rename ExplodeString to VectorizeStringDavid Kalnischkies
2010-03-30replace every call to toupper with one to our own tolower_asciiDavid Kalnischkies
This sounds like a premature optimization and since Mr. Knuth we all know that they are the root of all evil - but, and here it starts to be interesting: As the tolower_ascii method is by far the most called method we have (~60 Mio. times) and as we compare only strings containing ascii characters (package names, configuration options) using our own method reduces execution time of APT by 4% plus it avoids that the locale settings can influence us.