--- wine-20051107/dlls/gdi32/printdrv.c.orig 2005-11-25 11:39:55 +0200 +++ wine-20051107/dlls/gdi32/printdrv.c 2005-11-25 11:49:03 +0200 @@ -457,19 +457,27 @@ /* TTD convert the 'output device' into a spool file name */ - if (pszOutput == NULL || *pszOutput == '\0') - return -1; - - psCmd[0] = 0; - /* @@ Wine registry key: HKCU\Software\Wine\Printing\Spooler */ - if(!RegOpenKeyA(HKEY_CURRENT_USER, "Software\\Wine\\Printing\\Spooler", &hkey)) - { - DWORD type, count = sizeof(psCmd); - RegQueryValueExA(hkey, pszOutput, 0, &type, (LPBYTE)psCmd, &count); - RegCloseKey(hkey); + if ( pszOutput && *pszOutput) + { + psCmd[0] = 0; + /* @@ Wine registry key: HKCU\Software\Wine\Printing\Spooler */ + if(!RegOpenKeyA(HKEY_CURRENT_USER, "Software\\Wine\\Printing\\Spooler", &hkey)) + { + DWORD type, count = sizeof(psCmd); + RegQueryValueExA(hkey, pszOutput, 0, &type, (LPBYTE)psCmd, &count); + RegCloseKey(hkey); + } + if (!psCmd[0] && !strncmp("LPR:",pszOutput,4)) + sprintf(psCmd,"|lpr -P%s",pszOutput+4); + } + else + { +#ifdef HAVE_FORK + strcpy( psCmd,"|lpr"); +#else + return -1; +#endif } - if (!psCmd[0] && !strncmp("LPR:",pszOutput,4)) - sprintf(psCmd,"|lpr -P%s",pszOutput+4); TRACE("Got printerSpoolCommand '%s' for output device '%s'\n", psCmd, pszOutput);