summaryrefslogtreecommitdiff
path: root/s.el
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2015-08-25 09:33:18 +0200
committerGeorg Brandl <georg@python.org>2015-08-25 09:33:49 +0200
commit4ca1945d4c643d816b6a66cdb97b43ee9b982432 (patch)
tree4b6eb5408d4fedc99248c6c63e471f2aca7d8f38 /s.el
parente59915ec6fc35983fa4a164ff2a3f73df135ca88 (diff)
Fix s-split-up-to when string ends with separator (fixes #74)
Diffstat (limited to 's.el')
-rw-r--r--s.el8
1 files changed, 4 insertions, 4 deletions
diff --git a/s.el b/s.el
index 987652f..f145eb5 100644
--- a/s.el
+++ b/s.el
@@ -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)