Date: Sat, 25 Aug 2012 22:21:58 +0000 (UTC) From: Bryan Drewery <bdrewery@FreeBSD.org> To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r303161 - in head/devel/pkgconf: . files Message-ID: <201208252221.q7PMLwvX005654@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: bdrewery Date: Sat Aug 25 22:21:57 2012 New Revision: 303161 URL: http://svn.freebsd.org/changeset/ports/303161 Log: - Fix crash when running pkgconf with no path separators in the specified filename Approved by: bapt (maintainer, mentor) Obtained from: pkgconf git Added: head/devel/pkgconf/files/patch-fix-crash-with-no-path-separators (contents, props changed) Modified: head/devel/pkgconf/Makefile Modified: head/devel/pkgconf/Makefile ============================================================================== --- head/devel/pkgconf/Makefile Sat Aug 25 22:17:28 2012 (r303160) +++ head/devel/pkgconf/Makefile Sat Aug 25 22:21:57 2012 (r303161) @@ -7,7 +7,7 @@ PORTNAME= pkgconf PORTVERSION= 0.8.7 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= devel MASTER_SITES= http://tortois.es/~nenolod/distfiles/ \ http://files.etoilebsd.net/pkgconf/ Added: head/devel/pkgconf/files/patch-fix-crash-with-no-path-separators ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/devel/pkgconf/files/patch-fix-crash-with-no-path-separators Sat Aug 25 22:21:57 2012 (r303161) @@ -0,0 +1,26 @@ +--- pkg.c ++++ pkg.c +@@ -131,8 +131,8 @@ + char *pathbuf; + + strlcpy(buf, pkg->filename, sizeof buf); +- pathbuf = strrchr(buf, PKG_DIR_SEP_S); +- pathbuf[0] = '\0'; ++ if ((pathbuf = strrchr(buf, PKG_DIR_SEP_S)) != NULL) ++ pathbuf[0] = '\0'; + + return buf; + } +@@ -154,8 +154,10 @@ + pkg->vars = pkg_tuple_add(pkg->vars, "pcfiledir", pkg_get_parent_dir(pkg)); + + /* make module id */ +- idptr = strrchr(pkg->filename, PKG_DIR_SEP_S); +- idptr++; ++ if ((idptr = strrchr(pkg->filename, PKG_DIR_SEP_S)) != NULL) ++ idptr++; ++ else ++ idptr = pkg->filename; + + pkg->id = strdup(idptr); + idptr = strrchr(pkg->id, '.');
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201208252221.q7PMLwvX005654>