]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
lib: Remove the pointless unix_format() macro
authorVolker Lendecke <vl@samba.org>
Sat, 3 Jan 2026 08:52:48 +0000 (09:52 +0100)
committerVolker Lendecke <vl@samba.org>
Tue, 20 Jan 2026 11:53:34 +0000 (11:53 +0000)
One of the two callers even had a comment what it does...

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
source3/include/smb_macros.h
source3/lib/util.c
source3/printing/nt_printing.c

index 0d7ed45b770c6823fedca2d299fc43f39a83aacc..73a9c78ef2e1653d64aacf68674bf4714a4506d9 100644 (file)
@@ -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.
index 41e18b5559169ca551acf5fa9a3ba0fd80bb70d8..11c0425c151d06164737beec5f3cbb565aba845c 100644 (file)
@@ -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;
index 7683e312f2e8988aacd97a8a9aa5fa548db6530d..fb70fbacea8af3efee0acddc819cb3cad73e331b 100644 (file)
@@ -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;