summaryrefslogtreecommitdiff
path: root/source3/smbd/mangle.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2001-07-04 07:36:09 +0000
committerAndrew Tridgell <tridge@samba.org>2001-07-04 07:36:09 +0000
commit527e824293ee934ca5da0ef5424efe5ab7757248 (patch)
treedd86fab3b0ba9cdbd86661dfae562fa123a8f53c /source3/smbd/mangle.c
parent87fbb7092b8f8b2f0db0f361c3d625e19de57cd9 (diff)
downloadsamba-527e824293ee934ca5da0ef5424efe5ab7757248.tar.gz
samba-527e824293ee934ca5da0ef5424efe5ab7757248.tar.bz2
samba-527e824293ee934ca5da0ef5424efe5ab7757248.zip
strchr and strrchr are macros when compiling with optimisation in gcc, so we can't redefine them. damn.
(This used to be commit c41fc06376d1a2b83690612304e85010b5e5f3cf)
Diffstat (limited to 'source3/smbd/mangle.c')
-rw-r--r--source3/smbd/mangle.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/source3/smbd/mangle.c b/source3/smbd/mangle.c
index 8df71d4557..16286a8bb1 100644
--- a/source3/smbd/mangle.c
+++ b/source3/smbd/mangle.c
@@ -85,11 +85,11 @@ extern BOOL case_mangle; /* If true, all chars in 8.3 should be same case. */
*
* isbasecahr() - Given a character, check the chartest array to see
* if that character is in the basechars set. This is
- * faster than using strchr().
+ * faster than using strchr_m().
*
* isillegal() - Given a character, check the chartest array to see
* if that character is in the illegal characters set.
- * This is faster than using strchr().
+ * This is faster than using strchr_m().
*
* mangled_cache - Cache header used for storing mangled -> original
* reverse maps.
@@ -181,7 +181,7 @@ static BOOL is_reserved_msdos( char *fname )
StrnCpy (upperFname, fname, 12);
/* lpt1.txt and con.txt etc are also illegal */
- p = strchr(upperFname,'.');
+ p = strchr_m(upperFname,'.');
if( p )
*p = '\0';
@@ -287,14 +287,14 @@ BOOL is_mangled( char *s )
if( !ct_initialized )
init_chartest();
- magic = strchr( s, magic_char );
+ magic = strchr_m( s, magic_char );
while( magic && magic[1] && magic[2] ) /* 3 chars, 1st is magic. */
{
if( ('.' == magic[3] || '/' == magic[3] || !(magic[3])) /* Ends with '.' or nul or '/' ? */
&& isbasechar( toupper(magic[1]) ) /* is 2nd char basechar? */
&& isbasechar( toupper(magic[2]) ) ) /* is 3rd char basechar? */
return( True ); /* If all above, then true, */
- magic = strchr( magic+1, magic_char ); /* else seek next magic. */
+ magic = strchr_m( magic+1, magic_char ); /* else seek next magic. */
}
return( False );
} /* is_mangled */
@@ -318,7 +318,7 @@ BOOL is_8_3( char *fname, BOOL check_case )
int l;
char *p;
char *dot_pos;
- char *slash_pos = strrchr( fname, '/' );
+ char *slash_pos = strrchr_m( fname, '/' );
/* If there is a directory path, skip it. */
if( slash_pos )
@@ -389,7 +389,7 @@ BOOL is_8_3( char *fname, BOOL check_case )
/* see smb.conf(5) for a description of the 'strip dot' parameter. */
if( lp_strip_dot()
&& len - l == 1
- && !strchr( dot_pos + 1, '.' ) )
+ && !strchr_m( dot_pos + 1, '.' ) )
{
*dot_pos = 0;
return( True );
@@ -400,7 +400,7 @@ BOOL is_8_3( char *fname, BOOL check_case )
return( False );
/* extensions may not have a dot */
- if( strchr( dot_pos+1, '.' ) )
+ if( strchr_m( dot_pos+1, '.' ) )
return( False );
/* must be in 8.3 format */
@@ -537,8 +537,8 @@ static void cache_mangled_name( char *mangled_name, char *raw_name )
/* See if the extensions are unmangled. If so, store the entry
* without the extension, thus creating a "group" reverse map.
*/
- s1 = strrchr( mangled_name, '.' );
- if( s1 && (s2 = strrchr( raw_name, '.' )) )
+ s1 = strrchr_m( mangled_name, '.' );
+ if( s1 && (s2 = strrchr_m( raw_name, '.' )) )
{
i = 1;
while( s1[i] && (tolower( s1[1] ) == s2[i]) )
@@ -595,7 +595,7 @@ BOOL check_mangled_cache( char *s )
/* If we didn't find the name *with* the extension, try without. */
if( !FoundPtr )
{
- ext_start = strrchr( s, '.' );
+ ext_start = strrchr_m( s, '.' );
if( ext_start )
{
if((saved_ext = strdup(ext_start)) == NULL)
@@ -833,7 +833,7 @@ void mangle_name_83( char *s)
extension[0] = 0;
base[0] = 0;
- p = strrchr(s,'.');
+ p = strrchr_m(s,'.');
if( p && (strlen(p+1) < (size_t)4) )
{
BOOL all_normal = ( strisnormal(p+1) ); /* XXXXXXXXX */