From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, T_TVD_MIME_EPI autolearn=no autolearn_force=no version=3.4.4 Received: (qmail 9831 invoked from network); 13 Oct 2023 07:30:22 -0000 Received: from bsd.lv (HELO mandoc.bsd.lv) (66.111.2.12) by inbox.vuxu.org with ESMTPUTF8; 13 Oct 2023 07:30:22 -0000 Received: from fantadrom.bsd.lv (localhost [127.0.0.1]) by mandoc.bsd.lv (OpenSMTPD) with ESMTP id 68f90ec3 for ; Fri, 13 Oct 2023 07:30:21 +0000 (UTC) Received: from mx2.freebsd.org (mx2.freebsd.org [96.47.72.81]) by mandoc.bsd.lv (OpenSMTPD) with ESMTP id d573e901 for ; Fri, 13 Oct 2023 07:30:21 +0000 (UTC) Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits)) (Client CN "mx1.freebsd.org", Issuer "R3" (verified OK)) by mx2.freebsd.org (Postfix) with ESMTPS id 4S6J7d0vYnz4bh3 for ; Fri, 13 Oct 2023 07:30:21 +0000 (UTC) (envelope-from bapt@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4S6J7c6NFvz4FH6 for ; Fri, 13 Oct 2023 07:30:20 +0000 (UTC) (envelope-from bapt@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1697182220; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type; bh=lX0hRIUjde9patiVnzlL9x3wW4DWpPNeg+A/0eRX1zw=; b=QSgBxNc3H38BvE6Cq4QCLfbLNYyB8HIUIIWEBxVNdoTkw0MKDZPFXl8fibTQdipYHMZbP9 n81DcnsnkmA2hw9ouuyTmoLct5V4ksDQLbBbQ9ixTQwQlFA5yO0DIX6C8vMrbzLvaQLkdN XUfwKDgm0PUmA0+RXrSUqlvN6MBIE1go7rHkCOE1ZVX1ooVzCpvmGCq/pkPQWmlSMpUAc1 QGWZminb1N/0If/ceopu4t5YI+K/iv/DvwrI7R4IlLJ453NyTbZUcplVk9LaxAzRAuqw0a rJYYAnNoij6Dl5DqiAHs10rcucC1XQ9Bkz3DH07Ib2jWloUfGROhkxym5v7b7Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1697182220; a=rsa-sha256; cv=none; b=fz7z83M1hfDJ+a+//h87dp0vEZPRRLxs+B94dIauemaZ3QSjbYVKUQ2RbwgbKnY9ZwNPxt uGP40fWBrrNfCW3J9IAMwt/phcWh8JLJQI57+ixIFJGL9N7ObYJ87X9h3QLWG4NCOJdoXF dzfiYI/Pov65lRt9qHb9xxJrPXSVnZzhnv0JkBR5vr9WDrDP6NPaVPyhkSMB6KiGdIlKRB o3ykFitF5ir0mB7/6RVp5NuVZ3N9tTHiCWRpzRO92sDe/DjwshQDkoW5ZnQNM2sBRe0k18 JNYwif7Y4GZfHSSpKB2YtT3b5kufOujLJEiCRakAEOF9zLYG5GvOWDDSfFhT9g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1697182220; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type; bh=lX0hRIUjde9patiVnzlL9x3wW4DWpPNeg+A/0eRX1zw=; b=xgDi5el6AeRJImlRkyZpQ+vZlw1iYlkCMQf2Dg2L9zWJXeXZHry785P21FeClx2GynNbub HdXqYz4dMhSqxplVUpO9LPjP/rUaWBYcfi37jvZ9O4pCGL7wz9z8Pf41h2MqdtcaN50jcy CUuWc4g1sBVoEQss5QRaY2Hbv8HixAwaDw5wz/GNDBf1SeVX7V9Sso21/LviNCOC7ri+qV 70XLUJu0C2+BSz+tZdDr6u4TsRoGufmYjJaelxuqjhjQEJ/fxOZGHXKG7TN+TRguIS3uYO TweS0d9YE5UFabXzBOjvqnZy7MHV6b4FpHE4x+6Tq1rKcoJEydzJ7eJAZ/z8bw== Received: from aniel.nours.eu (nours.eu [IPv6:2001:41d0:8:3a4d::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: bapt) by smtp.freebsd.org (Postfix) with ESMTPSA id 4S6J7c4hVLz1BfD for ; Fri, 13 Oct 2023 07:30:20 +0000 (UTC) (envelope-from bapt@freebsd.org) Received: by aniel.nours.eu (Postfix, from userid 1001) id 5D3F7138721; Fri, 13 Oct 2023 09:30:18 +0200 (CEST) Date: Fri, 13 Oct 2023 09:30:18 +0200 From: Baptiste Daroussin To: tech@mandoc.bsd.lv Subject: Naive patch for handling empty input Message-ID: X-Mailinglist: mandoc-tech Reply-To: tech@mandoc.bsd.lv MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="55kuw4sryl3xzrie" Content-Disposition: inline --55kuw4sryl3xzrie Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hello, Please find attached a naive patch to handle dealing with empty This is probably a two naive approach, but I didn't want to come with empty hands :D the issue is the following: ./mandoc "); meta = mparse_result(parser); + if (meta == NULL) + return; if (meta->macroset == MACROSET_MDOC) { switch (outtype) { case OUTT_ASCII: Index: read.c =================================================================== RCS file: /cvs/mandoc/read.c,v retrieving revision 1.221 diff -u -r1.221 read.c --- read.c 19 May 2022 14:48:56 -0000 1.221 +++ read.c 13 Oct 2023 07:28:41 -0000 @@ -716,6 +716,8 @@ struct roff_meta * mparse_result(struct mparse *curp) { + if (curp->line == 0) + return (NULL); roff_state_reset(curp->man); if (curp->options & MPARSE_VALIDATE) { if (curp->man->meta.macroset == MACROSET_MDOC) --55kuw4sryl3xzrie-- -- To unsubscribe send an email to tech+unsubscribe@mandoc.bsd.lv