From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2155) id 156FC3858D32; Sat, 11 Feb 2023 11:58:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 156FC3858D32 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1676116706; bh=KgSJ2vCbUtK0CZXidYleHrn8UcwAT8BMPJt/X2XBfrE=; h=From:To:Subject:Date:From; b=kX24/mmnPe0zz1p1XPnR583HtiwkVgv8uMyISK7JkLzEWbti3Yg74gbRLZgbAfAjH LqVp1vy1jNk95cifKxD7nteiob/yCW/sSGDvzjhEqjpbRT7uBmLFm1g6Pna9j+YALC HpfdfncxWizWO4dRubv2fUvj18D73SdLHgjrhOpY= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Corinna Vinschen To: cygwin-cvs@sourceware.org Subject: [newlib-cygwin/main] Cygwin: cygcheck: fix dependency search X-Act-Checkin: newlib-cygwin X-Git-Author: Corinna Vinschen X-Git-Refname: refs/heads/main X-Git-Oldrev: 498fce80ef33d6ee11aed6f3bd8feda277bc4b30 X-Git-Newrev: b030a77dff515a857cf60bfc53a2a5e5e239cbb2 Message-Id: <20230211115826.156FC3858D32@sourceware.org> Date: Sat, 11 Feb 2023 11:58:26 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dnewlib-cygwin.git;h=3Db030a77dff5= 15a857cf60bfc53a2a5e5e239cbb2 commit b030a77dff515a857cf60bfc53a2a5e5e239cbb2 Author: Corinna Vinschen AuthorDate: Sat Feb 11 12:53:34 2023 +0100 Commit: Corinna Vinschen CommitDate: Sat Feb 11 12:53:34 2023 +0100 Cygwin: cygcheck: fix dependency search =20 Spaces are filtered out by PathMatchSpecA so they can't be used as pattern anchors. Overwrite all spaces with commas and fix the search expresion accordingly. =20 Signed-off-by: Corinna Vinschen Diff: --- winsup/utils/mingw/cygcheck.cc | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/winsup/utils/mingw/cygcheck.cc b/winsup/utils/mingw/cygcheck.cc index 66af2ce0b6a2..b5bad4ec20e2 100644 --- a/winsup/utils/mingw/cygcheck.cc +++ b/winsup/utils/mingw/cygcheck.cc @@ -2430,15 +2430,22 @@ collect_pkg_info (FILE *fp, ini_package_info *pi, b= ool search) else { /* For pattern matching we need a standarized format. - Make sure all deps are prepended by a space and all deps - are trailed by a comma. Note the missing space, that's - deliberate to keep it in the stored string. */ + Make sure all deps are prepended and trailed by a comma. + Note the missing space after the colon, that's deliberate + to keep it in the stored string. Originally we kept the + spaces in, but spaces are filtered out by PathMatchSpecA, + so we now replace all space by comma here. */ char *start =3D buf + strlen ("depends2:"); size_t len =3D strlen (start); =20 vinfo->depends2 =3D (char *) calloc (len + 2, 1); if (vinfo->depends2) - *stpcpy (vinfo->depends2, start) =3D ','; + { + *stpcpy (vinfo->depends2, start) =3D ','; + char *cp =3D vinfo->depends2; + while ((cp =3D strchr (cp, ' '))) + *cp =3D ','; + } } } else if (!strncmp (buf, "build-depends: ", @@ -2455,7 +2462,12 @@ collect_pkg_info (FILE *fp, ini_package_info *pi, bo= ol search) =20 vinfo->build_depends =3D (char *) calloc (len + 2, 1); if (vinfo->build_depends) - *stpcpy (vinfo->build_depends, start) =3D ','; + { + *stpcpy (vinfo->build_depends, start) =3D ','; + char *cp =3D vinfo->build_depends; + while ((cp =3D strchr (cp, ' '))) + *cp++ =3D ','; + } } } } @@ -2810,7 +2822,7 @@ package_search (char **search, int selector) ep =3D ext_search; if (selector) { - ep =3D stpcpy (ep, "* "); + ep =3D stpcpy (ep, "*,"); ep =3D stpcpy (ep, *search); ep =3D stpcpy (ep, ",*"); }