UserInterface/PathBegin_Check [ Functions ]
FUNCTION
Checks the validity of a path. A path should start with
./
or
/
or
have a ':' some where
SYNOPSIS
static int PathBegin_Check( char *path )
INPUTS
- path -- the path to be cheked.
RESULT
- FALSE -- path is not OK.
- TRUE -- path is OK.
SOURCE
{ int result = FALSE; int l = strlen( path ); if ( l == 1 ) { result = ( path[0] == '.' ); } else if ( l >= 2 ) { result = ( ( path[0] == '.' ) && ( path[1] == '/' ) ) || ( path[0] == '/' ) || ( strchr( path, ':' ) != NULL ); } else { /* Empty */ } return result; }