From a24e60841032e54e01ed65a05e687a52af4af0dc Mon Sep 17 00:00:00 2001 From: Wichert Akkerman Date: Tue, 2 Jul 2002 10:39:55 +0000 Subject: [PATCH] check for malloc failure and actually look in /home/wichert for file instead of looking in confdir twice --- ChangeLog | 6 ++++++ debian/changelog | 8 +++++++- lib/myopt.c | 8 +++++--- version-nr | 2 +- 4 files changed, 19 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 52830748..adf26a2d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Tue Jul 2 12:29:52 CEST 2002 Wichert Akkerman + + * Merge from HEAD: + + lib/myopt: check for malloc failure and actually look in $HOME for + file instead of looking in confdir twice + Tue Jul 2 10:20:40 CEST 2002 Wichert Akkerman * debian/rules: cp instead of mv since we need files for both dpkg diff --git a/debian/changelog b/debian/changelog index b46916ad..5c4b7435 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +dpkg (1.10.2) unstable; urgency=low + + * Make configuration files in $HOME work again + + -- Wichert Akkerman UNRELEASED + dpkg (1.10.1) unstable; urgency=low * Add conflict with dpkg-iasearch which intruded on our namespace. @@ -11,7 +17,7 @@ dpkg (1.10.1) unstable; urgency=low Closes: Bug#150739 * Move dpkg.cfg and dselect.cfg manpages into dpkg package. Closes: Bug#132901 - -- Wichert Akkerman Tue, 2 Jul 2002 10:30:34 +0200 + -- Wichert Akkerman Tue, 2 Jul 2002 12:34:07 +0200 dpkg (1.10) unstable; urgency=low diff --git a/lib/myopt.c b/lib/myopt.c index 9d7c044c..19488336 100644 --- a/lib/myopt.c +++ b/lib/myopt.c @@ -3,7 +3,7 @@ * myopt.c - my very own option parsing * * Copyright (C) 1994,1995 Ian Jackson - * Copyright (C) 2000 Wichert Akkerman + * Copyright (C) 2000,2002 Wichert Akkerman * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as @@ -90,15 +90,17 @@ void loadcfgfile(const char *prog, const struct cmdinfo* cmdinfos) { int l1, l2; l1 = strlen(CONFIGDIR "/.cfg") + strlen(prog); file = malloc(l1 + 1); + if (file==NULL) ohshite(_("Error allocating memory for cfgfilename")); sprintf(file, CONFIGDIR "/%s.cfg", prog); myfileopt(file, cmdinfos); if ((home = getenv("HOME")) != NULL) { - l2 = strlen(home) + strlen("/.cfg") + strlen(prog); + l2 = strlen(home) + 1 + strlen("/.cfg") + strlen(prog); if (l2 > l1) { free(file); file = malloc(l2 + 1); - l1 = l2; + if (file==NULL) ohshite(_("Error allocating memory for cfgfilename")); } + sprintf(file, "%s/.%s.cfg", home, prog); myfileopt(file, cmdinfos); } free(file); diff --git a/version-nr b/version-nr index 4dae2985..5ad2491c 100644 --- a/version-nr +++ b/version-nr @@ -1 +1 @@ -1.10.1 +1.10.2 -- 2.39.5