[Top][All Lists]

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

Re: [PATCH] fts: reduce two or more trailing spaces to just one, usually

From: Dmitry V. Levin
Subject: Re: [PATCH] fts: reduce two or more trailing spaces to just one, usually
Date: Thu, 1 Nov 2012 03:28:08 +0400

On Tue, Sep 04, 2012 at 01:09:24PM +0200, Jim Meyering wrote:
> Here's the revised commit:
> >From 3a9002d3cc63da7110f133b1040d2d2b0aad8305 Mon Sep 17 00:00:00 2001
> From: Jim Meyering <address@hidden>
> Date: Tue, 4 Sep 2012 11:36:38 +0200
> Subject: [PATCH] fts: reduce two or more trailing slashes to just one,
>  usually
> * lib/fts.c (fts_open): Upon initialization, if a name ends in two
> or more slashes, trim all but the final one.  But if a name consists
> solely of two slashes, don't modify it.  If it consists solely of
> three or more slashes, strip all but one.
> This is part of the solution to a minor problem with rm:
> it would print a bogus ELOOP diagnostic when failing to remove
> the slash-decorated name of a symlink-to-directory:
>     $ mkdir d && ln -s d s && env rm -r s/
>     rm: cannot remove 's': Too many levels of symbolic links
> With the change below and a trivial don't-trim-trailing-slashes
> adjustment to remove.c, it does this:
>     $ env rm -r s/
>     rm: cannot remove 's/': Not a directory
> Improved by: Eric Blake

JFYI, a side effect of this commit is that find(1) output changed:
before$ find /// -prune
after$ find /// -prune

Found by find/testsuite/find.gnu/name-slash.exp, I'm not sure
whether find or its test suite has to be updated.


Attachment: pgpu3lRou7mxt.pgp
Description: PGP signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]