Mercurial > hg > octave-shane > gnulib-hg
annotate modules/setenv @ 17074:d4ccb0388f18
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
author | Jim Meyering <meyering@redhat.com> |
---|---|
date | Tue, 04 Sep 2012 11:36:38 +0200 |
parents | 9a04eac49081 |
children |
rev | line source |
---|---|
4110 | 1 Description: |
4172 | 2 setenv() function: set an environment variable. |
4110 | 3 |
4 Files: | |
5 lib/setenv.c | |
6 m4/setenv.m4 | |
7 | |
8 Depends-on: | |
9545
c596ca4e89b4
Split setenv module into setenv and unsetenv. Get rid of setenv.h.
Bruno Haible <bruno@clisp.org>
parents:
8948
diff
changeset
|
9 stdlib |
14683
efab6978105e
Avoid unnecessary compilation units, through conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
13725
diff
changeset
|
10 malloca [test $HAVE_SETENV = 0 || test $REPLACE_SETENV = 1] |
efab6978105e
Avoid unnecessary compilation units, through conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
13725
diff
changeset
|
11 alloca-opt [test $HAVE_SETENV = 0 || test $REPLACE_SETENV = 1] |
efab6978105e
Avoid unnecessary compilation units, through conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
13725
diff
changeset
|
12 unistd [test $HAVE_SETENV = 0 || test $REPLACE_SETENV = 1] |
efab6978105e
Avoid unnecessary compilation units, through conditional dependencies.
Bruno Haible <bruno@clisp.org>
parents:
13725
diff
changeset
|
13 environ [test $HAVE_SETENV = 0 || test $REPLACE_SETENV = 1] |
4110 | 14 |
15 configure.ac: | |
8306
e3b1cbd15bc4
Split gt_FUNC_SETENV into gl_FUNC_SETENV and gl_FUNC_UNSETENV.
Bruno Haible <bruno@clisp.org>
parents:
7497
diff
changeset
|
16 gl_FUNC_SETENV |
15089
9a04eac49081
setenv: Move AC_LIBOBJ invocations to module description.
Bruno Haible <bruno@clisp.org>
parents:
14683
diff
changeset
|
17 if test $HAVE_SETENV = 0 || test $REPLACE_SETENV = 1; then |
9a04eac49081
setenv: Move AC_LIBOBJ invocations to module description.
Bruno Haible <bruno@clisp.org>
parents:
14683
diff
changeset
|
18 AC_LIBOBJ([setenv]) |
9a04eac49081
setenv: Move AC_LIBOBJ invocations to module description.
Bruno Haible <bruno@clisp.org>
parents:
14683
diff
changeset
|
19 fi |
9545
c596ca4e89b4
Split setenv module into setenv and unsetenv. Get rid of setenv.h.
Bruno Haible <bruno@clisp.org>
parents:
8948
diff
changeset
|
20 gl_STDLIB_MODULE_INDICATOR([setenv]) |
4110 | 21 |
22 Makefile.am: | |
23 | |
24 Include: | |
9545
c596ca4e89b4
Split setenv module into setenv and unsetenv. Get rid of setenv.h.
Bruno Haible <bruno@clisp.org>
parents:
8948
diff
changeset
|
25 <stdlib.h> |
4110 | 26 |
5251
42b53a22aee5
Add a license tag to every module.
Bruno Haible <bruno@clisp.org>
parents:
5063
diff
changeset
|
27 License: |
13725 | 28 LGPLv2+ |
5251
42b53a22aee5
Add a license tag to every module.
Bruno Haible <bruno@clisp.org>
parents:
5063
diff
changeset
|
29 |
4197 | 30 Maintainer: |
31 Bruno Haible | |
32 |