diff --git a/lisp/net/puny.el b/lisp/net/puny.el index 50bde85..b8a7cac 100644 --- a/lisp/net/puny.el +++ b/lisp/net/puny.el @@ -150,10 +150,12 @@ puny-decode-digit (defun puny-decode-string-internal (string) (with-temp-buffer (insert string) + ;; The encoded chars are after the final dash, if any (goto-char (point-max)) - (search-backward "-" nil (point-min)) - ;; The encoded chars are after the final dash. - (let ((encoded (buffer-substring (1+ (point)) (point-max))) + (if (search-backward "-" (point-min) t) + (forward-char 1) + (goto-char (point-min))) + (let ((encoded (buffer-substring (point) (point-max))) (ic 0) (i 0) (bias puny-initial-bias)