diff --git a/lib/util.h b/lib/util.h index 921cc1089..6696d02d1 100644 --- a/lib/util.h +++ b/lib/util.h @@ -234,7 +234,6 @@ void save_stop_handler (void); char *tilde_expand (const char *directory); void canonicalize_pathname_custom (char *path, canon_path_flags_t flags); -void canonicalize_pathname (char *path); char *mc_realpath (const char *path, char *resolved_path); @@ -279,7 +278,9 @@ void mc_replace_error (GError ** dest, int code, const char *format, ...) G_GNUC gboolean mc_time_elapsed (gint64 * timestamp, gint64 delay); -/*** inline functions **************************************************/ +/* --------------------------------------------------------------------------------------------- */ +/*** inline functions ****************************************************************************/ +/* --------------------------------------------------------------------------------------------- */ static inline gboolean exist_file (const char *name) @@ -287,10 +288,31 @@ exist_file (const char *name) return (access (name, R_OK) == 0); } +/* --------------------------------------------------------------------------------------------- */ + static inline gboolean is_exe (mode_t mode) { return ((mode & (S_IXUSR | S_IXGRP | S_IXOTH)) != 0); } +/* --------------------------------------------------------------------------------------------- */ +/** + * Canonicalize path with CANON_PATH_ALL. + * + * @param path path to file + * @param flags canonicalization flags + * + * All modifications of @path are made in place. + * Well formed UNC paths are modified only in the local part. + */ + +static inline void +canonicalize_pathname (char *path) +{ + canonicalize_pathname_custom (path, CANON_PATH_ALL); +} + +/* --------------------------------------------------------------------------------------------- */ + #endif /* MC_UTIL_H */ diff --git a/lib/utilunix.c b/lib/utilunix.c index f580591e4..564fcc5c9 100644 --- a/lib/utilunix.c +++ b/lib/utilunix.c @@ -759,8 +759,6 @@ tilde_expand (const char *directory) * @param path path to file * @param flags canonicalization flags * - * @return a new path - * * All modifications of @path are made in place. * Well formed UNC paths are modified only in the local part. */ @@ -986,25 +984,6 @@ canonicalize_pathname_custom (char *path, canon_path_flags_t flags) } } -/* --------------------------------------------------------------------------------------------- */ -/** - * Canonicalize path with CANON_PATH_ALL. - * - * @param path path to file - * @param flags canonicalization flags - * - * @return a new path - * - * All modifications of @path are made in place. - * Well formed UNC paths are modified only in the local part. - */ - -void -canonicalize_pathname (char *path) -{ - canonicalize_pathname_custom (path, CANON_PATH_ALL); -} - /* --------------------------------------------------------------------------------------------- */ char *