diff --git a/programs/wcmd/wcmdmain.c b/programs/wcmd/wcmdmain.c index 385db4ea850..3044a5a8392 100644 --- a/programs/wcmd/wcmdmain.c +++ b/programs/wcmd/wcmdmain.c @@ -505,7 +505,8 @@ char filetorun[MAX_PATH]; WCMD_batch (param1, command, 0); return; } - if (strpbrk( ext, "/\\:" )) ext = NULL; + + if (ext && strpbrk( ext, "/\\:" )) ext = NULL; if (!ext) { strcpy (filetorun, param1);