From: Michael Vogt Date: Sun, 5 Jan 2014 09:06:26 +0000 (+0100) Subject: Merge remote-tracking branch 'donkult/feature/clientmergepdiffs' into debian/experime... X-Git-Tag: 0.9.14.3.exp1~3 X-Git-Url: https://git.saurik.com/apt.git/commitdiff_plain/77002164d1339af01d74339766c51581784bebf1?hp=-c Merge remote-tracking branch 'donkult/feature/clientmergepdiffs' into debian/experimental-no-abi-break --- 77002164d1339af01d74339766c51581784bebf1 diff --combined apt-pkg/contrib/fileutl.cc index efbf7aaf4,130e990c3..ffb8b4b53 --- a/apt-pkg/contrib/fileutl.cc +++ b/apt-pkg/contrib/fileutl.cc @@@ -465,7 -465,7 +465,7 @@@ std::vector GetListOfFilesInDir const char *C = Ent->d_name; for (; *C != 0; ++C) if (isalpha(*C) == 0 && isdigit(*C) == 0 - && *C != '_' && *C != '-') { + && *C != '_' && *C != '-' && *C != ':') { // no required extension -> dot is a bad character if (*C == '.' && Ext.empty() == false) continue; @@@ -1827,20 -1827,3 +1827,20 @@@ std::vector Glob(std::stri return result; } /*}}}*/ + +std::string GetTempDir() +{ + const char *tmpdir = getenv("TMPDIR"); + +#ifdef P_tmpdir + if (!tmpdir) + tmpdir = P_tmpdir; +#endif + + // check that tmpdir is set and exists + struct stat st; + if (!tmpdir || strlen(tmpdir) == 0 || stat(tmpdir, &st) != 0) + tmpdir = "/tmp"; + + return string(tmpdir); +}