Fix.
[elisp/semi.git] / pgg-gpg.el
index 957ea61..43421e6 100644 (file)
@@ -79,7 +79,8 @@
         process status exit-status)
     (when pgg-gpg-messages-locale
       (setq process-environment (copy-sequence process-environment))
-      (setenv "LC_ALL" pgg-gpg-messages-locale))
+      (setenv "LC_ALL" pgg-gpg-messages-locale)
+      (setenv "LANGUAGE" pgg-gpg-messages-locale))
     (with-current-buffer (get-buffer-create errors-buffer)
       (buffer-disable-undo)
       (erase-buffer))
     (with-temp-buffer
       (apply #'call-process pgg-gpg-program nil t nil args)
       (goto-char (point-min))
-      (if (re-search-forward "^\\(sec\\|pub\\):"  nil t)
-         (substring
-          (nth 3 (split-string
-                  (buffer-substring (match-end 0)
-                                    (progn (end-of-line)(point)))
-                  ":")) 8)))))
+      (if (re-search-forward "^\\(sec\\|pub\\):[^:]*:[^:]*:[^:]*:\\([^:]*\\)"
+                            nil t)
+         (substring (match-string 2) 8)))))
 
 (luna-define-method pgg-scheme-encrypt-region ((scheme pgg-scheme-gpg)
                                               start end recipients)