At 14:50 16/01/01 +0200, Peter Pentchev wrote:
>As somebody already pointed out, there *is* a dirname(3) function, and even
>a dirname(1) cmdline utility to invoke it.
oops. I'll need to stay current:)
>In a followup to Alfred's mkdir(1) commit, I sent a sample implementation
>of a direxname()
On Tue, Jan 16, 2001 at 01:32:13PM +0100, mouss wrote:
> These are probably cosmetic comments, but here they are anyway...
>
>
> At 09:54 13/01/01 +, W.H.Scholten wrote:
>
> >+char *dirname(char *path) {
> >+ char *slash;
> >+
> >+ while (path[ strlen(path)-1 ] == '/') path[ str
These are probably cosmetic comments, but here they are anyway...
At 09:54 13/01/01 +, W.H.Scholten wrote:
>+char *dirname(char *path) {
>+ char *slash;
>+
>+ while (path[ strlen(path)-1 ] == '/') path[ strlen(path)-1 ] = 0;
if path is an empty string, you are accessing path[-1
In message <[EMAIL PROTECTED]> Ben Smithurst writes:
: while (path[strlen(path) - 1] == '/')
: path[strlen(path) - 1] = 0;
:
: :-) Preferably '\0' too of course like you say later.
Yes. Actually, I'd do this like:
cp = path + strlen(path) - 1;
while (cp > pa
* Alfred Perlstein <[EMAIL PROTECTED]> [010113 19:15] wrote:
> * W.H.Scholten <[EMAIL PROTECTED]> [010113 01:57] wrote:
> > Alfred Perlstein wrote:
> >
> > [ mkdir ]
> >
> > > I'll commit the patch shortly.
> >
> > Here's a better patch, it checks for multiple slashes, so mkdir
> > /tmp/aa///bb
* Warner Losh <[EMAIL PROTECTED]> [010113 19:55] wrote:
> In message <[EMAIL PROTECTED]> "W.H.Scholten" writes:
> : + while (path[ strlen(path)-1 ] == '/') path[ strlen(path)-1 ] = 0;
>
> Style(9) says write this like:
> while (path[ strlen(path)-1 ] == '/')
> path[ strlen(p
On Sat, Jan 13, 2001 at 10:14:16PM -0800, Kris Kennaway wrote:
> On Sat, Jan 13, 2001 at 07:14:32PM -0800, Alfred Perlstein wrote:
>
> > Actually, there already exists a function called dirname in libc, dirname(3).
> >
> > Here's what I'm going to commit:
>
> You might also like to contribute t
On Sat, Jan 13, 2001 at 07:14:32PM -0800, Alfred Perlstein wrote:
> Actually, there already exists a function called dirname in libc, dirname(3).
>
> Here's what I'm going to commit:
You might also like to contribute this back to the pppd maintainer
([EMAIL PROTECTED])..although since our versi
Warner Losh wrote:
> In message <[EMAIL PROTECTED]> "W.H.Scholten" writes:
> : + while (path[ strlen(path)-1 ] == '/') path[ strlen(path)-1 ] = 0;
>
> Style(9) says write this like:
> while (path[ strlen(path)-1 ] == '/')
> path[ strlen(path)-1 ] = 0;
No it doesn't.
"No
In message <[EMAIL PROTECTED]> "W.H.Scholten" writes:
: + while (path[ strlen(path)-1 ] == '/') path[ strlen(path)-1 ] = 0;
Style(9) says write this like:
while (path[ strlen(path)-1 ] == '/')
path[ strlen(path)-1 ] = 0;
: +
: + slash = strrchr(path, '/');
: +
* W.H.Scholten <[EMAIL PROTECTED]> [010113 01:57] wrote:
> Alfred Perlstein wrote:
>
> [ mkdir ]
>
> > I'll commit the patch shortly.
>
> Here's a better patch, it checks for multiple slashes, so mkdir
> /tmp/aa///bb will give:
>
> mkdir: /tmp/aa: No such file or directory
>
> Also, renam
Alfred Perlstein wrote:
[ mkdir ]
> I'll commit the patch shortly.
Here's a better patch, it checks for multiple slashes, so mkdir
/tmp/aa///bb will give:
mkdir: /tmp/aa: No such file or directory
Also, renamed the function to dirname as it does the same as dirname(1).
Regards,
Wouter
* W.H.Scholten <[EMAIL PROTECTED]> [010112 03:13] wrote:
> Alfred Perlstein wrote:
>
> > > 1. a pppd patch which sends the pppd messages to stderr.
> >
> > not sure about this one, I would open a PR about it.
>
> I'm not sure either :) Maybe everyone else uses gui frontend which reads
> pppd's s
Alfred Perlstein wrote:
> > 1. a pppd patch which sends the pppd messages to stderr.
>
> not sure about this one, I would open a PR about it.
I'm not sure either :) Maybe everyone else uses gui frontend which reads
pppd's syslog messages or starts pppd as root?
> Ok, I may be misreading this, b
* W.H.Scholten <[EMAIL PROTECTED]> [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 mes
15 matches
Mail list logo