summaryrefslogtreecommitdiff
path: root/cmdline/apt-get.cc
diff options
context:
space:
mode:
authorMichael Vogt <mvo@debian.org>2014-01-25 22:39:21 +0100
committerMichael Vogt <mvo@debian.org>2014-01-25 22:39:21 +0100
commit72af508bdbca55d0752aab3369faa1dc944a04e7 (patch)
tree933b60b160f1876990bb02bab20fcdb491c8b560 /cmdline/apt-get.cc
parentb52e8ce26ee0ee906f8bad4dbd72eca51fb65ed7 (diff)
parente093518c03b49a2def83d8b680be4490fed6e69c (diff)
Merge branch 'debian/sid' into ubuntu/master
Conflicts: configure.ac debian/changelog doc/apt-verbatim.ent doc/po/apt-doc.pot po/ar.po po/ast.po po/bg.po po/bs.po po/ca.po po/cs.po po/cy.po po/da.po po/de.po po/dz.po po/el.po po/es.po po/eu.po po/fi.po po/fr.po po/gl.po po/hu.po po/it.po po/ja.po po/km.po po/ko.po po/ku.po po/lt.po po/mr.po po/nb.po po/ne.po po/nl.po po/nn.po po/pl.po po/pt.po po/pt_BR.po po/ro.po po/ru.po po/sk.po po/sl.po po/sv.po po/th.po po/tl.po po/tr.po po/uk.po po/vi.po po/zh_CN.po po/zh_TW.po
Diffstat (limited to 'cmdline/apt-get.cc')
-rw-r--r--cmdline/apt-get.cc10
1 files changed, 4 insertions, 6 deletions
diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc
index 74d11e553..a5bc7b5fb 100644
--- a/cmdline/apt-get.cc
+++ b/cmdline/apt-get.cc
@@ -1539,14 +1539,12 @@ bool DoChangelog(CommandLine &CmdL)
bool const downOnly = _config->FindB("APT::Get::Download-Only", false);
char tmpname[100];
- char* tmpdir = NULL;
+ const char* tmpdir = NULL;
if (downOnly == false)
{
- const char* const tmpDir = getenv("TMPDIR");
- if (tmpDir != NULL && *tmpDir != '\0')
- snprintf(tmpname, sizeof(tmpname), "%s/apt-changelog-XXXXXX", tmpDir);
- else
- strncpy(tmpname, "/tmp/apt-changelog-XXXXXX", sizeof(tmpname));
+ std::string systemTemp = GetTempDir();
+ snprintf(tmpname, sizeof(tmpname), "%s/apt-changelog-XXXXXX",
+ systemTemp.c_str());
tmpdir = mkdtemp(tmpname);
if (tmpdir == NULL)
return _error->Errno("mkdtemp", "mkdtemp failed");