From owner-freebsd-bugs Sun Feb 20 12:40: 4 2000 Delivered-To: freebsd-bugs@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (Postfix) with ESMTP id 4EA3C37BF08 for ; Sun, 20 Feb 2000 12:40:01 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id MAA35996; Sun, 20 Feb 2000 12:40:01 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from germanium.xtalwind.net (germanium.xtalwind.net [205.160.242.5]) by hub.freebsd.org (Postfix) with ESMTP id 1434637BE8A for ; Sun, 20 Feb 2000 12:37:13 -0800 (PST) (envelope-from jack@germanium.xtalwind.net) Received: (from jack@localhost) by germanium.xtalwind.net (8.9.3/8.9.3) id PAA03376; Sun, 20 Feb 2000 15:37:10 -0500 (EST) Message-Id: <200002202037.PAA03376@germanium.xtalwind.net> Date: Sun, 20 Feb 2000 15:37:10 -0500 (EST) From: jack@germanium.xtalwind.net Reply-To: jack@germanium.xtalwind.net To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.2 Subject: misc/16839: MFC Matthew D. Fuller's patch to deal with full pathnames" Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 16839 >Category: misc >Synopsis: MFC Matthew D. Fuller's patch to deal with full pathnames" >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Sun Feb 20 12:40:00 PST 2000 >Closed-Date: >Last-Modified: >Originator: >Release: FreeBSD 3.4-STABLE i386 >Organization: >Environment: >Description: Matthew D. Fuller's "Teach pkg_delete how to deal with full pathnames" (/var/db/pkg/foo-1.0, instead of just foo-1.0) with Jordan's style fix. >How-To-Repeat: >Fix: --- main.c.orig Sun Aug 29 11:45:18 1999 +++ main.c Sun Feb 20 15:29:50 2000 @@ -41,6 +41,7 @@ { int ch, error; char **pkgs, **start; + char *pkgs_split; pkgs = start = argv; while ((ch = getopt(argc, argv, Options)) != -1) @@ -82,8 +83,26 @@ /* Get all the remaining package names, if any */ /* Get all the remaining package names, if any */ - while (*argv) - *pkgs++ = *argv++; + while (*argv) { + if ((pkgs_split = rindex(*argv, (int)'/')) != NULL) { + while (!isalpha(*(pkgs_split + 1))) { + *pkgs_split = '\0'; + if ((pkgs_split = rindex(*argv, (int) '/')) == NULL) + pkgs_split = *argv; + } + if (pkgs_split != NULL) { + if (*pkgs_split == '/') + pkgs_split++; + *pkgs = pkgs_split; + pkgs++; + } + } + else { + *pkgs = *argv; + pkgs++; + } + argv++; + } /* If no packages, yelp */ if (pkgs == start) >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message