diff options
| author | Noam Postavsky | 2017-06-01 23:09:36 -0400 |
|---|---|---|
| committer | Noam Postavsky | 2017-07-04 20:04:42 -0400 |
| commit | 2a9d7394e36524c84fcbd61e4058b9fb89e3cc2b (patch) | |
| tree | 7c109e4589a638f770bc72f8cb16472a919c2344 | |
| parent | 903c874d1018270643d63d8f258e0cc7dfd89951 (diff) | |
| download | emacs-2a9d7394e36524c84fcbd61e4058b9fb89e3cc2b.tar.gz emacs-2a9d7394e36524c84fcbd61e4058b9fb89e3cc2b.zip | |
Fix infloop in uncomment-region-default (Bug#27112)
When `comment-continue' has only blanks, `comment-padright' produces a
regexp that matches the empty string, so `uncomment-region-default'
will loop infinitely.
* lisp/newcomment.el (comment-padright): Only return a regexp if STR
has nonblank characters.
| -rw-r--r-- | lisp/newcomment.el | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lisp/newcomment.el b/lisp/newcomment.el index 4b261c34c65..118549f421c 100644 --- a/lisp/newcomment.el +++ b/lisp/newcomment.el | |||
| @@ -815,7 +815,7 @@ N defaults to 0. | |||
| 815 | If N is `re', a regexp is returned instead, that would match | 815 | If N is `re', a regexp is returned instead, that would match |
| 816 | the string for any N." | 816 | the string for any N." |
| 817 | (setq n (or n 0)) | 817 | (setq n (or n 0)) |
| 818 | (when (and (stringp str) (not (string= "" str))) | 818 | (when (and (stringp str) (string-match "\\S-" str)) |
| 819 | ;; Separate the actual string from any leading/trailing padding | 819 | ;; Separate the actual string from any leading/trailing padding |
| 820 | (string-match "\\`\\s-*\\(.*?\\)\\s-*\\'" str) | 820 | (string-match "\\`\\s-*\\(.*?\\)\\s-*\\'" str) |
| 821 | (let ((s (match-string 1 str)) ;actual string | 821 | (let ((s (match-string 1 str)) ;actual string |