]> arthur.barton.de Git - netatalk.git/commitdiff
remove bogus default ppd _PATH_PAPDPPDFILE, from Olaf Hering
authordidg <didg>
Wed, 21 Jan 2009 04:07:05 +0000 (04:07 +0000)
committerdidg <didg>
Wed, 21 Jan 2009 04:07:05 +0000 (04:07 +0000)
etc/papd/main.c
etc/papd/ppd.c
etc/papd/ppd.h

index a2a9b10cffd9674d44cb7ab1f585de547848b69c..6aabc126a118354f82f78169d88d680c4059923c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: main.c,v 1.18.6.2.2.5 2009-01-19 02:25:57 didg Exp $
+ * $Id: main.c,v 1.18.6.2.2.6 2009-01-21 04:07:05 didg Exp $
  *
  * Copyright (c) 1990,1995 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
@@ -72,7 +72,6 @@ char *strchr (), *strrchr ();
 #include "uam_auth.h"
 #include "print_cups.h"
 
-#define _PATH_PAPDPPDFILE      ".ppd"
 
 #define PIPED_STATUS   "status: print spooler processing job"
 
@@ -201,7 +200,6 @@ int main( ac, av )
     defprinter.p_type = "LaserWriter";
     defprinter.p_zone = "*";
     memset(&defprinter.p_addr, 0, sizeof(defprinter.p_addr));
-    defprinter.p_ppdfile = _PATH_PAPDPPDFILE;
 #ifdef __svr4__
     defprinter.p_flags = P_PIPED;
     defprinter.p_printer = "/usr/bin/lp -T PS";
@@ -681,9 +679,7 @@ static void getprinters( cf )
        /*
         * Get PPD file.
         */
-       if (( p = pgetstr( "pd", &a )) == NULL ) {
-           pr->p_ppdfile = defprinter.p_ppdfile;
-       } else {
+       if (( p = pgetstr( "pd", &a ) )) {
            if (( pr->p_ppdfile = (char *)malloc( strlen( p ) + 1 )) == NULL ) {
                perror( "malloc" );
                exit( 1 );
@@ -822,7 +818,7 @@ int rprintcap( pr )
      * Check for ppd file, moved here because of cups_autoadd we cannot check at the usual location
      */
 
-    if ( pr->p_ppdfile == defprinter.p_ppdfile ) {
+    if ( pr->p_ppdfile == NULL ) {
        if ( (p = (char *) cups_get_printer_ppd ( pr->p_printer )) != NULL ) {
            if (( pr->p_ppdfile = (char *)malloc( strlen( p ) + 1 )) == NULL ) {
                LOG(log_error, logtype_papd, "malloc: %s", strerror(errno) );
@@ -830,7 +826,7 @@ int rprintcap( pr )
            }
            strcpy( pr->p_ppdfile, p );
            pr->p_flags |= P_CUPS_PPD;
-           /*LOG(log_info, logtype_papd, "PPD File for %s set to %s", pr->p_printer, pr->p_ppdfile );*/
+           LOG(log_info, logtype_papd, "PPD File for %s set to %s", pr->p_printer, pr->p_ppdfile );
        }
     }
 
index 222428848b333cc4820daa43548178dcf0142bf4..b10d46d4cbfb309061b9a03b4cc2fb9831ba20d7 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: ppd.c,v 1.9.8.1.2.5 2009-01-21 02:32:16 didg Exp $
+ * $Id: ppd.c,v 1.9.8.1.2.6 2009-01-21 04:07:05 didg Exp $
  *
  * Copyright (c) 1995 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
@@ -51,16 +51,17 @@ struct ppdent {
 };
 
 #ifndef SHOWPPD
-int ppd_inited = 0;
+static int ppd_inited;
 
-int ppd_init()
+static void ppd_init()
 {
-    if ( ppd_inited ) {
-       return( -1 );
-    }
+    if (ppd_inited)
+        return;
+
     ppd_inited++;
 
-    return read_ppd( printer->p_ppdfile, 0 );
+    if (printer->p_ppdfile)
+        read_ppd( printer->p_ppdfile, 0 );
 }
 #endif /* SHOWPPD */
 
index bdfea746b32742ef8eaa06f54df6992f79a8744d..745356f5294bd7a11253268118964d0f8d56ad2c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * $Id: ppd.h,v 1.4 2001-06-25 20:13:45 rufustfirefly Exp $
+ * $Id: ppd.h,v 1.4.16.1 2009-01-21 04:07:05 didg Exp $
  *
  * Copyright (c) 1995 Regents of The University of Michigan.
  * All Rights Reserved.  See COPYRIGHT.
@@ -23,6 +23,5 @@ struct ppd_feature {
 struct ppd_feature     *ppd_feature __P((const char *, int));
 struct ppd_font                *ppd_font __P((char *));
 int read_ppd __P((char *, int));
-int ppd_init __P(( void ));
 
 #endif /* PAPD_PPD_H */