From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.2 required=3.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 347C81F44D for ; Mon, 6 May 2024 06:16:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1714976185; bh=fkvsSjvNflQS40rUbi3tMQfiirtxBwpNiwOuQdctCTk=; h=Date:From:To:Subject:References:In-Reply-To:From; b=1Gw/0CdkX5uI+zDh2wyRNC008y+Z9uMRnGZ1vduN3+q/itUx5KNR6vG65E0VaW2/8 M76z33LV5pdigJ36FS/y0tuWEMB5UjS9qPchBCbZ6tI66vowQd0BRyOXh1WX2euuRI 0pmAklLPyiIc60/JYgixkEsM65pfSW7OMGqyeGno= Date: Mon, 6 May 2024 06:08:39 +0000 From: Eric Wong To: meta@public-inbox.org Subject: Re: [PATCH] search: fix altid search with XapHelper process Message-ID: <20240506060839.M964200@dcvr> References: <20240505233510.1896122-1-e@80x24.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20240505233510.1896122-1-e@80x24.org> List-Id: Eric Wong wrote: > +++ b/lib/PublicInbox/xap_helper.h > @@ -126,6 +127,7 @@ typedef bool (*cmd)(struct req *); > struct req { // argv and pfxv point into global rbuf > char *argv[MY_ARG_MAX]; > char *pfxv[MY_ARG_MAX]; // -A > + char *qpfxv[MY_ARG_MAX]; // -A That comment is wrong. > +// setup query parser for altid and arbitrary headers > +static void srch_init_extra(struct req *req) > +{ > + const char *XPFX; > + for (int i = 0; i < req->qpfxc; i++) { > + size_t len = strlen(req->qpfxv[i]); > + char *c = (char *)memchr(req->qpfxv[i], '=', len); > + > + if (c) { // it's boolean gmane:XGMANE And so is that comment. Will squash this in before pushing: diff --git a/lib/PublicInbox/xap_helper.h b/lib/PublicInbox/xap_helper.h index 4e809fdd..bdc1c5b1 100644 --- a/lib/PublicInbox/xap_helper.h +++ b/lib/PublicInbox/xap_helper.h @@ -127,7 +127,7 @@ typedef bool (*cmd)(struct req *); struct req { // argv and pfxv point into global rbuf char *argv[MY_ARG_MAX]; char *pfxv[MY_ARG_MAX]; // -A - char *qpfxv[MY_ARG_MAX]; // -A + char *qpfxv[MY_ARG_MAX]; // -Q [:=] size_t *lenv; // -A LENGTH struct srch *srch; char *Pgit_dir; @@ -595,7 +595,7 @@ static void srch_init_extra(struct req *req) size_t len = strlen(req->qpfxv[i]); char *c = (char *)memchr(req->qpfxv[i], '=', len); - if (c) { // it's boolean gmane:XGMANE + if (c) { // it's boolean "gmane=XGMANE" XPFX = c + 1; *c = 0; req->srch->qp->add_boolean_prefix(req->qpfxv[i], XPFX);