Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/distrib/utils/sysinst Remove any leading '/'s in the pathnam...
details: https://anonhg.NetBSD.org/src/rev/f79f68b96b52
branches: trunk
changeset: 471675:f79f68b96b52
user: simonb <simonb%NetBSD.org@localhost>
date: Wed Apr 07 13:09:55 1999 +0000
description:
Remove any leading '/'s in the pathname component of the FTP URL.
When the complete URL is constructed, and '/' is inserted between
the hostname and the pathname components.
diffstat:
distrib/utils/sysinst/net.c | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
diffs (30 lines):
diff -r 44efb598e101 -r f79f68b96b52 distrib/utils/sysinst/net.c
--- a/distrib/utils/sysinst/net.c Wed Apr 07 12:47:27 1999 +0000
+++ b/distrib/utils/sysinst/net.c Wed Apr 07 13:09:55 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: net.c,v 1.39 1999/04/07 05:18:49 simonb Exp $ */
+/* $NetBSD: net.c,v 1.40 1999/04/07 13:09:55 simonb Exp $ */
/*
* Copyright 1997 Piermont Information Systems Inc.
@@ -100,6 +100,10 @@
* and reserved characters used for their reserved purposes may be
* used unencoded within a URL.
*
+ * The encoded URL _does_not_ start with a '/'. A '/' is inserted
+ * between the hostname and the pathname components when the complete
+ * URL is constructed.
+ *
*/
#define RFC1738_SAFE "$-_.+!*'(),"
@@ -114,6 +118,9 @@
if (safe_chars == NULL)
safe_chars = "";
+ /* Remove any initial '/'s if present */
+ while (*src == '/')
+ src++;
while (--len > 0 && *src != '\0') {
if (isalnum(*src) || strchr(safe_chars, *src)) {
*p++ = *src++;
Home |
Main Index |
Thread Index |
Old Index