Christophe
Weblog
Wiki
Code
Publications
Music
projects
/
squeeze-el.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
0e4ee58
)
handle the case when there are zero connected players
author
Christophe Rhodes
<csr21@cantab.net>
Thu, 30 Oct 2014 18:32:07 +0000
(18:32 +0000)
committer
Christophe Rhodes
<csr21@cantab.net>
Thu, 30 Oct 2014 18:32:07 +0000
(18:32 +0000)
squeeze.el
patch
|
blob
|
history
diff --git
a/squeeze.el
b/squeeze.el
index 25491596d5633e9b41ab235b8b1135376b9011b5..cfbca135f33a6ea7cd560bcca0592ebe22b0ec5d 100644
(file)
--- a/
squeeze.el
+++ b/
squeeze.el
@@
-394,12
+394,13
@@
(let ((count (squeeze-parse-count string))
(startpos (string-match "playerindex" string))
result endpos)
(let ((count (squeeze-parse-count string))
(startpos (string-match "playerindex" string))
result endpos)
- (dotimes (i (1- count))
- (setq endpos (progn (string-match " connected%3A[0-1] " string startpos)
- (match-end 0)))
- (push (apply 'squeeze-make-player (squeeze-string-plistify string startpos endpos)) result)
- (setq startpos endpos))
- (push (apply 'squeeze-make-player (squeeze-string-plistify string startpos (length string))) result)
+ (when (> count 0)
+ (dotimes (i (1- count))
+ (setq endpos (progn (string-match " connected%3A[0-1] " string startpos)
+ (match-end 0)))
+ (push (apply 'squeeze-make-player (squeeze-string-plistify string startpos endpos)) result)
+ (setq startpos endpos))
+ (push (apply 'squeeze-make-player (squeeze-string-plistify string startpos (length string))) result))
result))
result))