r20740: Get rid of some if-statements
authorVolker Lendecke <vlendec@samba.org>
Sat, 13 Jan 2007 20:26:53 +0000 (20:26 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 17:17:07 +0000 (12:17 -0500)
(This used to be commit db93c1b98d5445071ad0af229afed1f11ab0a862)

source3/smbd/reply.c

index 21c8b13b5c2b1be04f1ff792908395c4a8f892b6..7d89382a7d1aa8a15072d6a81e3deb9cec5437ab 100644 (file)
@@ -45,18 +45,16 @@ extern BOOL global_encrypted_passwords_negotiated;
 ****************************************************************************/
 
 NTSTATUS check_path_syntax_internal(pstring destname,
-                                       const pstring srcname,
-                                       BOOL windows_path, BOOL
-                                       *p_last_component_contains_wcard)
+                                   const pstring srcname,
+                                   BOOL windows_path,
+                                   BOOL *p_last_component_contains_wcard)
 {
        char *d = destname;
        const char *s = srcname;
        NTSTATUS ret = NT_STATUS_OK;
        BOOL start_of_name_component = True;
 
-       if (p_last_component_contains_wcard) {
-               *p_last_component_contains_wcard = False;
-       }
+       *p_last_component_contains_wcard = False;
 
        while (*s) {
                if (IS_DIRECTORY_SEP(*s)) {
@@ -74,9 +72,7 @@ NTSTATUS check_path_syntax_internal(pstring destname,
 
                        start_of_name_component = True;
                        /* New component. */
-                       if (p_last_component_contains_wcard) {
-                               *p_last_component_contains_wcard = False;
-                       }
+                       *p_last_component_contains_wcard = False;
                        continue;
                }
 
@@ -132,9 +128,7 @@ NTSTATUS check_path_syntax_internal(pstring destname,
                                        case '<':
                                        case '>':
                                        case '"':
-                                               if (p_last_component_contains_wcard) {
-                                                       *p_last_component_contains_wcard = True;
-                                               }
+                                               *p_last_component_contains_wcard = True;
                                                break;
                                        default:
                                                break;
@@ -181,7 +175,8 @@ NTSTATUS check_path_syntax_internal(pstring destname,
 
 NTSTATUS check_path_syntax(pstring destname, const pstring srcname)
 {
-       return check_path_syntax_internal(destname, srcname, True, NULL);
+       BOOL ignore;
+       return check_path_syntax_internal(destname, srcname, True, &ignore);
 }
 
 /****************************************************************************
@@ -203,7 +198,8 @@ NTSTATUS check_path_syntax_wcard(pstring destname, const pstring srcname, BOOL *
 
 static NTSTATUS check_path_syntax_posix(pstring destname, const pstring srcname)
 {
-       return check_path_syntax_internal(destname, srcname, False, NULL);
+       BOOL ignore;
+       return check_path_syntax_internal(destname, srcname, False, &ignore);
 }
 
 /****************************************************************************