lib/rename-dest-slash.c


Log

Author Commit Date CI Message
Paul Eggert 1fc2fce0 2006-10-12T05:36:20 * lib/rename-dest-slash.c: Include stdbool.h but not string.h. (has_trailing_slash): Omit size arg; all callers changed. Omit 'inline', since it doesn't help performance and we'd need to configure it. Don't count //, ///, etc. as having a trailing slash. As a side effect, this removes a C99ism reported by Matthew Woehlke. (rpl_rename_dest_slash): On failure, use rename's errno rather than (in some cases) an incorrect or junk errno. Simplify code by removing need to compute length; this does cause it to make two passes instead of one over the file name, but it's worth it.
Jim Meyering 23ba046d 2006-09-15T18:48:09 * rename-dest-slash.c (has_trailing_slash): Use FILE_SYSTEM_PREFIX_LEN, for non-POSIX systems. (rpl_rename_dest_slash): Perform the cheaper trailing slash test before testing whether SRC is a directory. Suggestions from Bruno Haible.
Jim Meyering 2dd00679 2006-09-15T13:49:12 [ChangeLog] * modules/rename-dest-slash: New module. * MODULES.html.sh (posix_compat): Add it here. [lib/ChangeLog] * rename-dest-slash.c: New file. [m4/ChangeLog] * rename-dest-slash.m4 (gl_FUNC_RENAME_TRAILING_DEST_SLASH): New file.