mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-08-27 03:42:49 +00:00
Cleanup fc_match_postscript_name
This commit is contained in:
parent
bc7f689165
commit
0b2726ec33
1 changed files with 4 additions and 3 deletions
|
|
@ -205,14 +205,15 @@ end:
|
|||
|
||||
static PyObject*
|
||||
fc_match_postscript_name(PyObject UNUSED *self, PyObject *args) {
|
||||
char *postscript_name = NULL;
|
||||
const char *postscript_name = NULL;
|
||||
FcPattern *pat = NULL;
|
||||
PyObject *ans = NULL;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "|z", &postscript_name)) return NULL;
|
||||
if (!PyArg_ParseTuple(args, "s", &postscript_name)) return NULL;
|
||||
if (!postscript_name || !postscript_name[0]) { PyErr_SetString(PyExc_KeyError, "postscript_name must not be empty"); return NULL; }
|
||||
|
||||
pat = FcPatternCreate();
|
||||
if (pat == NULL) return PyErr_NoMemory();
|
||||
if (!postscript_name || strlen(postscript_name) == 0) return NULL;
|
||||
|
||||
AP(FcPatternAddString, FC_POSTSCRIPT_NAME, (const FcChar8*)postscript_name, "postscript_name");
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue