From: didg Date: Wed, 21 Jan 2009 04:07:05 +0000 (+0000) Subject: remove bogus default ppd _PATH_PAPDPPDFILE, from Olaf Hering X-Git-Tag: netatalk-2-0-4-rc1~21 X-Git-Url: https://arthur.barton.de/gitweb/?a=commitdiff_plain;ds=sidebyside;h=fb2e06490f7f9e209e5e6e35a0baa525bc24e861;p=netatalk.git remove bogus default ppd _PATH_PAPDPPDFILE, from Olaf Hering --- diff --git a/etc/papd/main.c b/etc/papd/main.c index a2a9b10c..6aabc126 100644 --- a/etc/papd/main.c +++ b/etc/papd/main.c @@ -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 ); } } diff --git a/etc/papd/ppd.c b/etc/papd/ppd.c index 22242884..b10d46d4 100644 --- a/etc/papd/ppd.c +++ b/etc/papd/ppd.c @@ -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 */ diff --git a/etc/papd/ppd.h b/etc/papd/ppd.h index bdfea746..745356f5 100644 --- a/etc/papd/ppd.h +++ b/etc/papd/ppd.h @@ -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 */