From: "Christopher R. Hertel" <crh@NTS.Umn.EDU> Message-Id: <199803302335.RAA24610@unet.unet.umn.edu> Subject: is_mangled To: samba-technical@samba.anu.edu.au (samba-tech) Date: Mon, 30 Mar 1998 17:34:49 -0600 (CST)
Perhaps I'm splitting hairs but Jeremy warned me about playing around
inside mangle.c. I've written a new is_mangled function which is a bit
more selective and doesn't use recursion. The main behavioral change is
that it tests the two characters following the magic character to see if
they are in the basechars set.
If no one objects, I *will* make this change.
Chris -)-----
/* ************************************************************************** **
* Test a name in 8.3 format to see if it *might be* a mangled name.
* ************************************************************************** **
*/
int is_mangled( char *s )
{
char *magic = strchr( s, magic_char );
if( !magic || (strlen(magic) < 3) )
return( 0 );
if( strchr( basechars, toupper(magic[1]) )
&& strchr( basechars, toupper(magic[2]) )
&& strchr( ".", magic[3] )
)
return( 1 );
return( 0 );
} /* new_is_mangled */
-- Christopher R. Hertel -)----- University of Minnesota crh@nts.umn.edu Networking and Telecommunications Services