1 /* stripslash.c -- remove trailing slashes from a string
2 Copyright (C) 1990 Free Software Foundation, Inc.
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2, or (at your option)
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details. */
18 #if STDC_HEADERS || HAVE_STRING_H
20 /* An ANSI string.h and pre-ANSI memory.h might conflict. */
21 #if !STDC_HEADERS && HAVE_MEMORY_H
23 #endif /* not STDC_HEADERS and HAVE_MEMORY_H */
24 #else /* not STDC_HJEADERS and not HAVE_STRING_H */
26 /* memory.h and strings.h conflict on some systems. */
27 #endif /* not STDC_HEADERS and not HAVE_STRING_H */
29 /* Remove trailing slashes from PATH. */
32 strip_trailing_slashes (path
)
37 last
= strlen (path
) - 1;
38 while (last
> 0 && path
[last
] == '/')