Commit 5138a352 authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

Append .DRV to name only if no extension present.

parent 7d64d7d1
......@@ -167,10 +167,15 @@ LOADED_PRINTER_DRIVER *LoadPrinterDriver(const char *pszDriver)
}
{
char *drvName = malloc(strlen(pszDriver)+5);
char *p, *drvName = HeapAlloc(GetProcessHeap(), 0, strlen(pszDriver) + 5);
strcpy(drvName, pszDriver);
strcat(drvName, ".DRV");
/* Append .DRV to name if no extension present */
if (!(p = strrchr(drvName, '.')) || strchr(p, '/') || strchr(p, '\\'))
strcat(drvName, ".DRV");
hInst = LoadLibrary16(drvName);
HeapFree(GetProcessHeap(), 0, drvName);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment