From f93dcc2532e2fd53c7d19e6dd96d4846055b1cf4 Mon Sep 17 00:00:00 2001 From: Frederic Boulanger Date: Thu, 15 Jun 2000 00:29:54 +0000 Subject: [PATCH] CreateSpoolFile is called with a dos name, we have to make sure that when we create the spoolfile we use the unix name associated to the dos file name. --- misc/printdrv.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/misc/printdrv.c b/misc/printdrv.c index 39b353b2dc1..8090861a936 100644 --- a/misc/printdrv.c +++ b/misc/printdrv.c @@ -25,6 +25,7 @@ #include "callback.h" #include "options.h" #include "heap.h" +#include "file.h" DEFAULT_DEBUG_CHANNEL(print) @@ -421,7 +422,6 @@ static PPRINTJOB FindPrintJobFromHandle(HANDLE16 hHandle) return gPrintJobsTable[0]; } -/* TTD Need to do some DOS->UNIX file conversion here */ static int CreateSpoolFile(LPCSTR pszOutput) { int fd=-1; @@ -470,12 +470,20 @@ static int CreateSpoolFile(LPCSTR pszOutput) } else { + DOS_FULL_NAME fullName; + TRACE("Just assume its a file\n"); - if ((fd = open(psCmdP, O_CREAT | O_TRUNC | O_WRONLY , 0600)) < 0) + /** + * The file name can be dos based, we have to find its + * Unix correspondant file name + */ + DOSFS_GetFullName(psCmdP, FALSE, &fullName); + + if ((fd = open(fullName.long_name, O_CREAT | O_TRUNC | O_WRONLY , 0600)) < 0) { ERR("Failed to create spool file %s, errno = %d\n", - psCmdP, errno); + fullName.long_name, errno); } } return fd;