[resend] Don't crash when CUPS is installed

Leonard Norrgard vinsci at nic.funet.fi
Thu Aug 16 15:55:21 CDT 2001


[This hasn't been applied yet, so I'm resending it. CUPS, btw, is
the Common UNIX Printing System, available at http://www.cups.org,
go get it, if you haven't already!]

Hi all,

Having CUPS installed and a printer in CUPS configured would crash an
application I'm looking at. The reason was that the printer would be
added with a NULL name.

-- vinsci


--
Leonard Norrgård <vinsci at nic.funet.fi>


-------------- next part --------------
Index: info.c
===================================================================
RCS file: /home/wine/wine/dlls/winspool/info.c,v
retrieving revision 1.42
diff -u -r1.42 info.c
--- info.c	2001/07/02 19:59:47	1.42
+++ info.c	2001/08/01 23:42:19
@@ -144,7 +144,7 @@
 	WriteProfileStringA("devices",printers[i],devline);
 	HeapFree(GetProcessHeap(),0,devline);
 
-	if (!AddPrinterA(NULL,2,(LPBYTE)&pinfo2a)) {
+	if (!AddPrinterA(printers[i],2,(LPBYTE)&pinfo2a)) {
 	    if (GetLastError()!=ERROR_PRINTER_ALREADY_EXISTS)
 	        ERR("%s not added by AddPrinterA (%ld)\n",printers[i],GetLastError());
 	}


More information about the wine-patches mailing list