Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-3]: src/usr.bin/xinstall Pull up revision 1.88 (requested by luke...



details:   https://anonhg.NetBSD.org/src/rev/ad0212dc4201
branches:  netbsd-3
changeset: 575766:ad0212dc4201
user:      tron <tron%NetBSD.org@localhost>
date:      Tue May 10 12:42:02 2005 +0000

description:
Pull up revision 1.88 (requested by lukem in ticket #270):
metadata_log(): remove leading  -D destdir  before strsvis(3) encoding
the path, not after.

diffstat:

 usr.bin/xinstall/xinstall.c |  12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)

diffs (47 lines):

diff -r aead8230bbc3 -r ad0212dc4201 usr.bin/xinstall/xinstall.c
--- a/usr.bin/xinstall/xinstall.c       Tue May 10 12:39:45 2005 +0000
+++ b/usr.bin/xinstall/xinstall.c       Tue May 10 12:42:02 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: xinstall.c,v 1.87 2004/06/20 22:20:16 jmc Exp $        */
+/*     $NetBSD: xinstall.c,v 1.87.2.1 2005/05/10 12:42:02 tron Exp $   */
 
 /*
  * Copyright (c) 1987, 1993
@@ -46,7 +46,7 @@
 #if 0
 static char sccsid[] = "@(#)xinstall.c 8.1 (Berkeley) 7/21/93";
 #else
-__RCSID("$NetBSD: xinstall.c,v 1.87 2004/06/20 22:20:16 jmc Exp $");
+__RCSID("$NetBSD: xinstall.c,v 1.87.2.1 2005/05/10 12:42:02 tron Exp $");
 #endif
 #endif /* not lint */
 
@@ -1022,7 +1022,8 @@
        const char *link, const char *digestresult)
 {
        static const char       extra[] = { ' ', '\t', '\n', '\\', '#', '\0' };
-       char            *buf, *p;
+       const char      *p;
+       char            *buf;
        size_t          destlen;
        struct flock    metalog_lock;
 
@@ -1043,8 +1044,7 @@
                return;
        }
 
-       strsvis(buf, path, VIS_CSTYLE, extra);          /* encode name */
-       p = buf;                                        /* remove destdir */
+       p = path;                                       /* remove destdir */
        if (destdir) {
                destlen = strlen(destdir);
                if (strncmp(p, destdir, destlen) == 0 &&
@@ -1053,6 +1053,8 @@
        }
        while (*p && *p == '/')                         /* remove leading /s */
                p++;
+       strsvis(buf, p, VIS_CSTYLE, extra);             /* encode name */
+       p = buf;
                                                        /* print details */
        fprintf(metafp, ".%s%s type=%s mode=%#o", *p ? "/" : "", p, type, mode);
        if (link)



Home | Main Index | Thread Index | Old Index