1 /* -*- buffer-read-only: t -*- vi: set ro: */
2 /* DO NOT EDIT! GENERATED AUTOMATICALLY! */
4 Copyright (C) 2009, 2010 Free Software Foundation, Inc.
6 This program is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>. */
33 /* Create a symlink, but reject trailing slash. */
35 rpl_symlink (char const *contents, char const *name)
37 size_t len = strlen (name);
38 if (len && name[len - 1] == '/')
41 if (lstat (name, &st) == 0)
45 return symlink (contents, name);
48 #else /* !HAVE_SYMLINK */
50 /* The system does not support symlinks. */
52 symlink (char const *contents _GL_UNUSED,
53 char const *name _GL_UNUSED)
59 #endif /* !HAVE_SYMLINK */