Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 20 Feb 2000 15:37:10 -0500 (EST)
From:      jack@germanium.xtalwind.net
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   misc/16839: MFC Matthew D. Fuller's patch to deal with full pathnames"
Message-ID:  <200002202037.PAA03376@germanium.xtalwind.net>

next in thread | raw e-mail | index | archive | help

>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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200002202037.PAA03376>