diff --git a/ekp-utils.el b/ekp-utils.el index 172ae8a..9d20aaa 100644 --- a/ekp-utils.el +++ b/ekp-utils.el @@ -41,6 +41,10 @@ information is available (batch mode, tty frames)." (let ((family (face-attribute 'default :family))) (if (stringp family) family (format "%s" family))))) +;; GUI-only C function; absent in non-window-system builds (emacs-nox). +;; Call sites are guarded by `display-multi-font-p'. +(declare-function font-info "font.c" (name &optional frame)) + (defun ekp-font-monospace-p (font-family) "Return non-nil if FONT-FAMILY appears to be monospace. Returns nil (unknown) when font information is unavailable." diff --git a/ekp_c/ekp_hyphen.c b/ekp_c/ekp_hyphen.c index bfeda10..f5d1d1c 100644 --- a/ekp_c/ekp_hyphen.c +++ b/ekp_c/ekp_hyphen.c @@ -99,7 +99,9 @@ ekp_hyphenator_t *ekp_hyphen_create(const char *dict_path) char line[256]; size_t count = 0; - fgets(line, sizeof(line), fp); /* skip encoding line */ + if (!fgets(line, sizeof(line), fp)) { + /* empty file: no encoding line to skip; count loop sees EOF */ + } while (fgets(line, sizeof(line), fp)) { size_t len = strlen(line); @@ -128,7 +130,9 @@ ekp_hyphenator_t *ekp_hyphen_create(const char *dict_path) /* Second pass: parse patterns */ rewind(fp); - fgets(line, sizeof(line), fp); /* skip encoding line */ + if (!fgets(line, sizeof(line), fp)) { + /* empty file: no encoding line to skip; parse loop sees EOF */ + } size_t idx = 0; while (fgets(line, sizeof(line), fp)) {