Permalink
Browse files

jabber-core: Fix header parsing

The (1+ (match-end 0)) is a mistake. Indeed, after the replace-match
call the (match-end 0) point has changed to be at the end of the
replaced string. So calling (point) is more than enough.

Signed-off-by: Magnus Henoch <legoscia@users.sourceforge.net>
  • Loading branch information...
1 parent dc9fc0f commit a034d4b330d23643169880e96e34e0cf61b76a11 Jeremy Compostella committed with Dec 15, 2011
Showing with 2 additions and 2 deletions.
  1. +1 −0 AUTHORS
  2. +1 −2 jabber-core.el
View
1 AUTHORS
@@ -7,6 +7,7 @@ Evgenii Terechkov
Contributors:
Anthony Chaumas-Pellet
+Jérémy Compostella
Mathias Dahl
Mario Domenech Goulart
Nolan Eakins
View
3 jabber-core.el
@@ -858,8 +858,7 @@ DATA is any sexp."
;; Let's pretend that the stream header is a closed tag,
;; and parse it as such.
(replace-match "/>" t t nil 1)
- (let* (;; Thus we need to add one to the index...
- (ending-at (1+ (match-end 0)))
+ (let* ((ending-at (point))
(stream-header (car (xml-parse-region (point-min) ending-at)))
(session-id (jabber-xml-get-attribute stream-header 'id))
(stream-version (jabber-xml-get-attribute stream-header 'version)))

0 comments on commit a034d4b

Please sign in to comment.