diff options
| -rw-r--r-- | lisp/net/eww.el | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/lisp/net/eww.el b/lisp/net/eww.el index d5606365396..8ea17e01018 100644 --- a/lisp/net/eww.el +++ b/lisp/net/eww.el | |||
| @@ -1442,13 +1442,14 @@ Differences in #targets are ignored." | |||
| 1442 | (setq file "!")) | 1442 | (setq file "!")) |
| 1443 | ((string-match "\\`[.]" file) | 1443 | ((string-match "\\`[.]" file) |
| 1444 | (setq file (concat "!" file)))) | 1444 | (setq file (concat "!" file)))) |
| 1445 | (let ((count 1)) | 1445 | (let ((count 1) |
| 1446 | (stem file) | ||
| 1447 | (suffix "")) | ||
| 1448 | (when (string-match "\\`\\(.*\\)\\([.][^.]+\\)" file) | ||
| 1449 | (setq stem (match-string 1) | ||
| 1450 | suffix (match-string 2))) | ||
| 1446 | (while (file-exists-p (expand-file-name file directory)) | 1451 | (while (file-exists-p (expand-file-name file directory)) |
| 1447 | (setq file | 1452 | (setq file (format "%s(%d)%s" stem count suffix)) |
| 1448 | (if (string-match "\\`\\(.*\\)\\([.][^.]+\\)" file) | ||
| 1449 | (format "%s(%d)%s" (match-string 1 file) | ||
| 1450 | count (match-string 2 file)) | ||
| 1451 | (format "%s(%d)" file count))) | ||
| 1452 | (setq count (1+ count))) | 1453 | (setq count (1+ count))) |
| 1453 | (expand-file-name file directory))) | 1454 | (expand-file-name file directory))) |
| 1454 | 1455 | ||