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=-3.1 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 11171 invoked from network); 25 Feb 2022 15:45:18 -0000 Received: from mother.openwall.net (195.42.179.200) by inbox.vuxu.org with ESMTPUTF8; 25 Feb 2022 15:45:18 -0000 Received: (qmail 32310 invoked by uid 550); 25 Feb 2022 15:45:16 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 32277 invoked from network); 25 Feb 2022 15:45:15 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tavianator.com; s=google; h=mime-version:from:date:message-id:subject:to; bh=MSDiWBLbVQGU+xkyJXqEj99uLnVWoumb6s2elFB/wh0=; b=tEQukrRoVTpe8VOgQ0Z1JgTTkcmH7xzeeCQ3TfSbeq+BQnyH4M3hFeW2/F6zsT+mZ0 6zmJt+/jcyIuuN5NRkZBDL54gpIPoSoUH+ljkhBBBrMqMpca3xsLdlyDWqXEMOmfMbRM pekjSC/CNz1AwFuHISuGHrcZYJzfy/6V9aRxw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=MSDiWBLbVQGU+xkyJXqEj99uLnVWoumb6s2elFB/wh0=; b=G2ZXmknX+nP2/2CuHumA8KMoyGG61kL5jm0uLH8FzJmKYqwK9+PWWYg1/ibtOg7lhx KYntQgEmitisAngBeIevV/QYTzCKrmZr1yqPjIXeXqIfUepS2SMeNO19GeB80wPivUVd bpApuNgt5/wwrLWEwqiOK7GWTY7kFFNNMyrvgIsBTp0LnUB3OZcACZHXrehxEWHNzl0Z LU2XLcexo3hj6UKPc7RYXCyHjgBtkZDxSVloeAop4sfmLN8NTv12Wa4PX2dLIlcXtjkr 3HzhqiUN3S7l8eSt5ZRnGDGhdMpdw5T++LIUCFST2CbsTevaRk88XSUudF3AKlyv4gwE 1osQ== X-Gm-Message-State: AOAM533Z41wMFWZUWqQLueYsE7Q+ZuoYgTbTorLsYDBRuO6+3hhoW+Bi 5ZR11D5H0jNfXfZDMa22T2g1U2+zw2V9K958dHKjmhCvfpI= X-Google-Smtp-Source: ABdhPJz/BQTStn9vLLD/tfoFiGAgnqIk/iHhmwuIPpBGC7mAsBdpbOICm73/94HvfZ39NOB6TmxgXiAf/QMukwGrSWg= X-Received: by 2002:a25:614e:0:b0:61a:8d81:4df0 with SMTP id v75-20020a25614e000000b0061a8d814df0mr7682702ybb.543.1645803903308; Fri, 25 Feb 2022 07:45:03 -0800 (PST) MIME-Version: 1.0 From: Tavian Barnes Date: Fri, 25 Feb 2022 10:44:52 -0500 Message-ID: To: musl@lists.openwall.com Content-Type: text/plain; charset="UTF-8" Subject: [musl] fnmatch trailing backslash I noticed that fnmatch() behaviour with a trailing unescaped backslash differs between glibc and musl: $ cat foo.c #include #include int main(void) { assert(fnmatch("\\", "\\", 0) != 0); return 0; } $ gcc foo.c -o foo && ./foo $ musl-gcc foo.c -o foo && ./foo Assertion failed: fnmatch("\\", "\\", 0) != 0 (foo.c: main: 5) In https://pubs.opengroup.org/onlinepubs/9699919799/functions/fnmatch.html, POSIX says: > If pattern ends with an unescaped , fnmatch() shall return a non-zero value (indicating either no match or an error). And interestingly, it was a defect report from Rich that led to that wording: https://www.austingroupbugs.net/view.php?id=806 -- Tavian Barnes