From jack@germanium.xtalwind.net  Sun Feb 20 12:37:14 2000
Return-Path: <jack@germanium.xtalwind.net>
Received: from germanium.xtalwind.net (germanium.xtalwind.net [205.160.242.5])
	by hub.freebsd.org (Postfix) with ESMTP id 1434637BE8A
	for <FreeBSD-gnats-submit@freebsd.org>; 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
Subject: MFC Matthew D. Fuller's patch to deal with full pathnames"
X-Send-Pr-Version: 3.2

>Number:         16839
>Category:       misc
>Synopsis:       MFC Matthew D. Fuller's patch to deal with full pathnames"
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    dan
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sun Feb 20 12:40:00 PST 2000
>Closed-Date:    Mon Jun 25 20:57:03 PDT 2001
>Last-Modified:  Mon Jun 25 20:58:46 PDT 2001
>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:
Responsible-Changed-From-To: freebsd-bugs->dan  
Responsible-Changed-By: cpiazza 
Responsible-Changed-When: Sat Mar 4 15:27:44 PST 2000 
Responsible-Changed-Why:  
Dan committed it to HEAD, he can MFC it too. 
State-Changed-From-To: open->closed 
State-Changed-By: mikeh 
State-Changed-When: Mon Jun 25 20:57:03 PDT 2001 
State-Changed-Why:  
MFC'd with branch split. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=16839 
>Unformatted:
