openbsd-ports/print/py-cups/patches/patch-cupsppd_c
ajacoutot 75280f8be8 - update to py-cups-1.9.45
- add a small workaround because our CUPS is too old (CUPS will get a major
update on the next dev cycle)

ok jasper@
2009-01-31 12:36:59 +00:00

32 lines
1013 B
Plaintext

$OpenBSD: patch-cupsppd_c,v 1.2 2009/01/31 12:36:59 ajacoutot Exp $
--- cupsppd.c.orig Tue Dec 23 18:13:38 2008
+++ cupsppd.c Sat Jan 31 12:57:38 2009
@@ -274,6 +274,10 @@ PPD_localizeIPPReason (PPD *self, PyObject *args, PyOb
return NULL;
buffer = malloc (bufsize);
+#ifdef __OpenBSD__ // we need a newer CUPS
+ ret = Py_None;
+ Py_INCREF (Py_None);
+#else
if (ppdLocalizeIPPReason (self->ppd, reason, scheme, buffer, bufsize))
{
ret = make_PyUnicode_from_ppd_string (self, buffer);
@@ -281,6 +285,7 @@ PPD_localizeIPPReason (PPD *self, PyObject *args, PyOb
ret = Py_None;
Py_INCREF (Py_None);
}
+#endif // __OpenBSD__
free (buffer);
return ret;
@@ -507,7 +512,7 @@ PPD_nondefaultsMarked (PPD *self)
return PyBool_FromLong (nondefaults_marked);
}
-#ifdef __SVR4
+#if defined(__SVR4) || defined(__OpenBSD__)
/*
* A rudimentary emulation of getline() for systems that dont support it
* natively. Since this is used for PPD file reading, it assumes (possibly