From owner-freebsd-hackers Thu Jan 11 13:25:35 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from fw.wintelcom.net (ns1.wintelcom.net [209.1.153.20]) by hub.freebsd.org (Postfix) with ESMTP id 4E1F237B401 for ; Thu, 11 Jan 2001 13:25:18 -0800 (PST) Received: (from bright@localhost) by fw.wintelcom.net (8.10.0/8.10.0) id f0BLP9K25477; Thu, 11 Jan 2001 13:25:09 -0800 (PST) Date: Thu, 11 Jan 2001 13:25:09 -0800 From: Alfred Perlstein To: "W.H.Scholten" Cc: freebsd-hackers@FreeBSD.ORG Subject: Re: pppd & mkdir diff Message-ID: <20010111132509.J7240@fw.wintelcom.net> References: <3A5C843C.794BDF32@xs4all.nl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <3A5C843C.794BDF32@xs4all.nl>; from whs@xs4all.nl on Wed, Jan 10, 2001 at 03:48:12PM +0000 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG * W.H.Scholten [010111 13:17] wrote: > L.S. > > Here are two patches I've been using for a while on both 3.3R and 4.1R: > > 1. a pppd patch which sends the pppd messages to stderr. not sure about this one, I would open a PR about it. > 2. a mkdir patch changing an error message. > > If for example /tmp/aa does not exist then mkdir /tmp/aa/bb will report > /tmp/aa/bb: No such file or directory > This is true but not the point. The patch makes it say: > /tmp/aa: No such file or directory > > diff -ruN mkdir.orig/mkdir.c mkdir/mkdir.c > +char *path_prefix(char *path) { > + char *slash; > + > + if (path[ strlen(path)-1 ] == '/') path[ strlen(path)-1 ] = 0; > + > + slash = strrchr(path, '/'); > + if (slash) *slash = 0; > + > + return path; > +} Ok, I may be misreading this, but this doesn't fix it really: mkdir /tmp/a/b/c/d/e/f/s perhaps if you called "stat" in a loop to on each patch component until it failed you'd be able to trim off the directory paths one by one. -- -Alfred Perlstein - [bright@wintelcom.net|alfred@freebsd.org] "I have the heart of a child; I keep it in a jar on my desk." To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message