]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Portability fix for using null-device.
authorBruno Haible <bruno@clisp.org>
Mon, 16 Jul 2001 14:22:35 +0000 (14:22 +0000)
committerBruno Haible <bruno@clisp.org>
Mon, 16 Jul 2001 14:22:35 +0000 (14:22 +0000)
misc/ChangeLog
misc/po-mode.el

index e4001297acab835c4bbdb0a27f0ccc9d74442901..3c8747965a7011463e109de5b9895190f768a93c 100644 (file)
@@ -1,3 +1,9 @@
+2001-07-13  Karl Eichwalder  <ke@suse.de>
+
+       * 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  <pinard@iro.umontreal.ca>
 
        * po-mode.el (po-preset-string-functions): New function.
index ac8e1faeda9c0e76260e66f935ab156b679057c4..a40dbbfb8651630b42f3e808de54b80e8239bc10 100644 (file)
@@ -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)