diff options
author | Georg Brandl <georg@python.org> | 2015-08-25 09:33:18 +0200 |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2015-08-25 09:33:49 +0200 |
commit | 4ca1945d4c643d816b6a66cdb97b43ee9b982432 (patch) | |
tree | 4b6eb5408d4fedc99248c6c63e471f2aca7d8f38 /s.el | |
parent | e59915ec6fc35983fa4a164ff2a3f73df135ca88 (diff) |
Fix s-split-up-to when string ends with separator (fixes #74)
Diffstat (limited to 's.el')
-rw-r--r-- | s.el | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -76,10 +76,10 @@ See also `s-split'." (push sub r))) (setq op (goto-char (match-end 0))) (setq n (1- n))) - (if (/= (point) (point-max)) - (push (buffer-substring-no-properties op (point-max)) r) - (unless omit-nulls - (push "" r)))) + (let ((sub (buffer-substring-no-properties op (point-max)))) + (unless (and omit-nulls + (equal sub "")) + (push sub r)))) (nreverse r)))) (defun s-lines (s) |