svn commit: samba r23854 - in branches/SAMBA_3_0_25/source/lib: .

jra at samba.org jra at samba.org
Thu Jul 12 18:02:06 GMT 2007


Author: jra
Date: 2007-07-12 18:02:04 +0000 (Thu, 12 Jul 2007)
New Revision: 23854

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

Log:
Keep consistent with 3.2 (at least for now). Remove unneeded pstring.
Jeremy.

Modified:
   branches/SAMBA_3_0_25/source/lib/util.c


Changeset:
Modified: branches/SAMBA_3_0_25/source/lib/util.c
===================================================================
--- branches/SAMBA_3_0_25/source/lib/util.c	2007-07-12 13:41:34 UTC (rev 23853)
+++ branches/SAMBA_3_0_25/source/lib/util.c	2007-07-12 18:02:04 UTC (rev 23854)
@@ -1833,8 +1833,7 @@
 
 BOOL is_in_path(const char *name, name_compare_entry *namelist, BOOL case_sensitive)
 {
-	pstring last_component;
-	char *p;
+	const char *last_component;
 
 	/* if we have no list it's obviously not in the path */
 	if((namelist == NULL ) || ((namelist != NULL) && (namelist[0].name == NULL))) {
@@ -1844,8 +1843,12 @@
 	DEBUG(8, ("is_in_path: %s\n", name));
 
 	/* Get the last component of the unix name. */
-	p = strrchr_m(name, '/');
-	pstrcpy(last_component, p ? ++p : name);
+	last_component = strrchr_m(name, '/');
+	if (!last_component) {
+		last_component = name;
+	} else {
+		last_component++; /* Go past '/' */
+	}
 
 	for(; namelist->name != NULL; namelist++) {
 		if(namelist->is_wild) {
@@ -1862,7 +1865,6 @@
 		}
 	}
 	DEBUG(8,("is_in_path: match not found\n"));
- 
 	return False;
 }
 
@@ -2748,7 +2750,7 @@
  of the ".." name.
 *******************************************************************/
 
-BOOL mask_match(const char *string, char *pattern, BOOL is_case_sensitive)
+BOOL mask_match(const char *string, const char *pattern, BOOL is_case_sensitive)
 {
 	if (strcmp(string,"..") == 0)
 		string = ".";
@@ -2764,7 +2766,7 @@
  pattern translation.
 *******************************************************************/
 
-BOOL mask_match_search(const char *string, char *pattern, BOOL is_case_sensitive)
+BOOL mask_match_search(const char *string, const char *pattern, BOOL is_case_sensitive)
 {
 	if (strcmp(string,"..") == 0)
 		string = ".";



More information about the samba-cvs mailing list