Skip to content

Commit

Permalink
Detect absolute paths on Windows.
Browse files Browse the repository at this point in the history
  • Loading branch information
valeriuo committed Nov 27, 2019
1 parent 51f1092 commit 6273047
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion vcfplugin.c
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,12 @@ static void *dlopen_plugin(args_t *args, const char *fname)

void *handle;
char *tmp;
if ( fname[0]!='/' ) // not an absolute path
/**
* Detects both Unix and Windows style absolute paths.
* Windows accepts both forward slash (/) and backslash (\) as folder separator
* and can have any path prefixed by the drive letter and a colon (:).
*/
if ( fname[0]!='/' && fname[0]!='\\' && (fname[1]!=':' || (fname[2]!='/' && fname[2]!='\\')) ) // not an absolute path
{
int i;
for (i=0; i<args->nplugin_paths; i++)
Expand Down

0 comments on commit 6273047

Please sign in to comment.