From: Bruno Haible Date: Mon, 16 Jul 2001 14:22:35 +0000 (+0000) Subject: Portability fix for using null-device. X-Git-Tag: v0.11~605 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=876661f2d50155e6886249d94ad28e8cdca4ab36;p=thirdparty%2Fgettext.git Portability fix for using null-device. --- diff --git a/misc/ChangeLog b/misc/ChangeLog index e4001297a..3c8747965 100644 --- a/misc/ChangeLog +++ b/misc/ChangeLog @@ -1,3 +1,9 @@ +2001-07-13 Karl Eichwalder + + * po-mode.el (po-validate): Check for 'null-device; if not available + use "NUL" for windows-nt and windows-95 and /dev/null as fallback. + From Eli Zaretskii and François Pinard. + 2000-01-03 François Pinard * po-mode.el (po-preset-string-functions): New function. diff --git a/misc/po-mode.el b/misc/po-mode.el index ac8e1faed..a40dbbfb8 100644 --- a/misc/po-mode.el +++ b/misc/po-mode.el @@ -2659,14 +2659,16 @@ Leave point after marked string." (defun po-validate () "Use `msgfmt' for validating the current PO file contents." (interactive) - (let ((compilation-buffer-name-function - (function (lambda (mode) (progn "*PO validation*")))) - (compile-command (concat po-msgfmt-program - " --statistics -c -v -o " null-device " " + (let* ((dev-null + (cond ((boundp 'null-device) null-device) ; since Emacs 20.3 + ((memq system-type '(windows-nt windows-95)) "NUL") + (t "/dev/null"))) + (compilation-buffer-name-function + (function (lambda (mode) (progn "*PO validation*")))) + (compile-command (concat po-msgfmt-program + " --statistics -c -v -o " dev-null " " buffer-file-name))) - (po-msgfmt-version-check) - (compile compile-command))) (defvar po-msgfmt-version-checked nil)