From owner-freebsd-stable Sun Jul 2 8:29:25 2000 Delivered-To: freebsd-stable@freebsd.org Received: from peach.ocn.ne.jp (peach.ocn.ne.jp [210.145.254.87]) by hub.freebsd.org (Postfix) with ESMTP id 0B58637BD5C for ; Sun, 2 Jul 2000 08:29:22 -0700 (PDT) (envelope-from dcs@newsguy.com) Received: from newsguy.com (p10-dn03kiryunisiki.gunma.ocn.ne.jp [210.232.224.139]) by peach.ocn.ne.jp (8.9.1a/OCN/) with ESMTP id AAA28106; Mon, 3 Jul 2000 00:29:16 +0900 (JST) Message-ID: <395F5FF4.B2FA7753@newsguy.com> Date: Mon, 03 Jul 2000 00:29:56 +0900 From: "Daniel C. Sobral" X-Mailer: Mozilla 4.7 [en] (Win98; I) X-Accept-Language: en,pt-BR,ja MIME-Version: 1.0 To: Brad Knowles Cc: FreeBSD-STABLE Mailing List , Jens A Nilsson Subject: Re: regcomp(3) acting weird? References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Brad Knowles wrote: > > sps->sps_reg_errno = regcomp(&sps->sps_reg, sps->sps_name, cflags); > if (sps->sps_reg_errno != 0) { This is where you should place some helpful printfs, but your problem isn't here. For one thing... > free(sps); > return NULL; Notice how it frees sps and returns NULL in case of error, so one would never be able to retrieve the error anyway. For another thing, > However, spegla dies while trying to parse it: > > $ /usr/local/bin/spegla -f /usr/local/etc/spegla/interplay.conf > spegla: sps_init: Undefined error: 0 ^ > The section of spegla.c that is calling this routine is: > > /* ARGSUSED */ > static void > add_param_sps(int option, const char *arg, struct cl_sps_que **q) > { > struct sp_skip *sps; > > option = 0; /* quiet gcc */ > if (*q == NULL && ((*q = cl_sps_init()) == NULL)) > e_err(1, "cl_sps_init"); > if ((sps = sps_init(arg)) == NULL) > e_err(1, "sps_init"); ^^^^^^^^^^ > if (sps_error(sps)) > e_errx(1, "sps_init: %s", sps_strerror(sps)); ^ > (void) cl_sps_push(*q, sps); > } See how the error seems not to be a result of sps_init(), but of sps_error(). Could you please post sps_error() and struct sp_sip definition? -- Daniel C. Sobral (8-DCS) dcs@newsguy.com dcs@freebsd.org capo@the.great.underground.bsdconpiracy.org _DES: The Book of Bruce has only one sentence in it, and it says "the actual directives of my cult are left as an exercise for the reader. Good luck." jkh: does it really include the 'good luck' part? EE: OK, I made that part up. EE: I figured it should sound a bit more cheery than how Bruce initially dictated it to me. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message