Re: Problems with -d option to qconfirm
Gerrit Pape <[email protected]>
| Newsgroups | gmane.comp.misc.pape.general |
|---|---|
| Message-ID | <[email protected]> |
On Tue, Dec 02, 2003 at 09:13:36AM -0500, Chris Johnson wrote: > I've tried passing the -d option to the qconfirm program, and it > doesn't seem to work correctly: > > $ qconfirm -d .qconfirm list pending > qconfirm: fatal: unable to change directory: .qconfir/pending: file does not exist > Notice that it's trying to change to qconfir/pending, not > qconfirm/pending. If I set QONFIRM_DIR in the environment, it works. I can confirm this, it's a bug in parsing the command line option. Here's a patch. > $ qconfirm -d .qconfirm drop [email protected] > [email protected]: not pending. > > $ QCONFIRM_DIR=.qconfirm qconfirm drop [email protected] > [email protected]: drop. > > In this case, qconfirm didn't complain about a missing directory, but > it didn't find the pending address. Yes, it should complain if the directory doesn't exist, I'll see what I can do. Thanks for the reporting! Regards, Gerrit.
diff
(text/plain, 506 B)
Index: src/qconfirm.c
===================================================================
RCS file: /var/lib/cvs/qconfirm/src/qconfirm.c,v
retrieving revision 1.14
diff -u -r1.14 qconfirm.c
--- src/qconfirm.c 21 Nov 2003 13:45:53 -0000 1.14
+++ src/qconfirm.c 2 Dec 2003 17:40:39 -0000
@@ -623,6 +623,7 @@
switch(opt) {
case 'd':
if (! stralloc_copys(&qconfirm_dir, optarg)) die_nomem();
+ if (! stralloc_0(&qconfirm_dir)) die_nomem();
break;
case 'i':
forceid =1;