diff options
| author | Glenn Morris | 2017-03-01 20:35:41 -0500 |
|---|---|---|
| committer | Glenn Morris | 2017-03-01 20:35:41 -0500 |
| commit | 8c1e16bee492f7f8776805cfc051801e3da5cd20 (patch) | |
| tree | 6f5aaee0adc6432183ed981b4aba05fb800f8307 | |
| parent | 8244357283b740adacaa4526c0ea60349b0a93bb (diff) | |
| download | emacs-8c1e16bee492f7f8776805cfc051801e3da5cd20.tar.gz emacs-8c1e16bee492f7f8776805cfc051801e3da5cd20.zip | |
Small puny.el fix
* lisp/net/puny.el (puny-decode-string-internal):
Handle strings with no ascii parts. (Bug#23688)
| -rw-r--r-- | lisp/net/puny.el | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lisp/net/puny.el b/lisp/net/puny.el index c718d958be1..bdd59be070a 100644 --- a/lisp/net/puny.el +++ b/lisp/net/puny.el | |||
| @@ -150,10 +150,12 @@ For instance \"xn--bcher-kva\" => \"bücher\"." | |||
| 150 | (defun puny-decode-string-internal (string) | 150 | (defun puny-decode-string-internal (string) |
| 151 | (with-temp-buffer | 151 | (with-temp-buffer |
| 152 | (insert string) | 152 | (insert string) |
| 153 | (goto-char (point-max)) | 153 | ;; The encoded chars are after any final dash, else the whole string. |
| 154 | (search-backward "-" nil (point-min)) | 154 | (let ((encoded (buffer-substring |
| 155 | ;; The encoded chars are after the final dash. | 155 | (if (search-backward "-" nil 'move) |
| 156 | (let ((encoded (buffer-substring (1+ (point)) (point-max))) | 156 | (1+ (point)) |
| 157 | (point)) | ||
| 158 | (point-max))) | ||
| 157 | (ic 0) | 159 | (ic 0) |
| 158 | (i 0) | 160 | (i 0) |
| 159 | (bias puny-initial-bias) | 161 | (bias puny-initial-bias) |