From: Volker Lendecke Date: Sat, 3 Jan 2026 08:52:48 +0000 (+0100) Subject: lib: Remove the pointless unix_format() macro X-Git-Tag: tdb-1.4.15~24 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ec0a59bebd942b2ddd26d9bbd384a97f0715a3ea;p=thirdparty%2Fsamba.git lib: Remove the pointless unix_format() macro One of the two callers even had a comment what it does... Signed-off-by: Volker Lendecke Reviewed-by: Anoop C S --- diff --git a/source3/include/smb_macros.h b/source3/include/smb_macros.h index 0d7ed45b770..73a9c78ef2e 100644 --- a/source3/include/smb_macros.h +++ b/source3/include/smb_macros.h @@ -175,7 +175,6 @@ copy an IP address from one buffer to another ****************************************************************************/ #define IS_DIRECTORY_SEP(c) ((c) == '\\' || (c) == '/') -#define unix_format(fname) string_replace(fname,'\\','/') /**************************************************************************** Make a file into DOS format. diff --git a/source3/lib/util.c b/source3/lib/util.c index 41e18b55591..11c0425c151 100644 --- a/source3/lib/util.c +++ b/source3/lib/util.c @@ -1552,8 +1552,7 @@ char *valid_share_pathname(TALLOC_CTX *ctx, const char *dos_pathname) if (!ptr) { return NULL; } - /* Convert any '\' paths to '/' */ - unix_format(ptr); + string_replace(ptr, '\\', '/'); ptr = unix_clean_name(ctx, ptr); if (!ptr) { return NULL; diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c index 7683e312f2e..fb70fbacea8 100644 --- a/source3/printing/nt_printing.c +++ b/source3/printing/nt_printing.c @@ -252,7 +252,7 @@ static NTSTATUS driver_unix_convert(connection_struct *conn, if (!name) { return NT_STATUS_NO_MEMORY; } - unix_format(name); + string_replace(name, '\\', '/'); name = unix_clean_name(ctx, name); if (!name) { return NT_STATUS_NO_MEMORY;