svn commit: samba r20740 - in branches: SAMBA_3_0/source/smbd SAMBA_3_0_24/source/smbd

vlendec at samba.org vlendec at samba.org
Sat Jan 13 20:26:54 GMT 2007


Author: vlendec
Date: 2007-01-13 20:26:53 +0000 (Sat, 13 Jan 2007)
New Revision: 20740

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=20740

Log:
Get rid of some if-statements
Modified:
   branches/SAMBA_3_0/source/smbd/reply.c
   branches/SAMBA_3_0_24/source/smbd/reply.c


Changeset:
Modified: branches/SAMBA_3_0/source/smbd/reply.c
===================================================================
--- branches/SAMBA_3_0/source/smbd/reply.c	2007-01-13 20:02:10 UTC (rev 20739)
+++ branches/SAMBA_3_0/source/smbd/reply.c	2007-01-13 20:26:53 UTC (rev 20740)
@@ -45,18 +45,16 @@
 ****************************************************************************/
 
 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 @@
 
 			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 @@
 					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(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 @@
 
 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);
 }
 
 /****************************************************************************

Modified: branches/SAMBA_3_0_24/source/smbd/reply.c
===================================================================
--- branches/SAMBA_3_0_24/source/smbd/reply.c	2007-01-13 20:02:10 UTC (rev 20739)
+++ branches/SAMBA_3_0_24/source/smbd/reply.c	2007-01-13 20:26:53 UTC (rev 20740)
@@ -45,18 +45,16 @@
 ****************************************************************************/
 
 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 @@
 
 			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 @@
 					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(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 @@
 
 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);
 }
 
 /****************************************************************************



More information about the samba-cvs mailing list