Permalink
Browse files

Making splicing of SD happen backwards.

Going "forwards" in the loop prevented multiple SD's (which are valid) from
being parsed out.
  • Loading branch information...
squeeks committed Mar 9, 2013
1 parent 657c8e7 commit a93920ff255774fcc10bc5fd3a6618b206996304
Showing with 4 additions and 4 deletions.
  1. +4 −4 lib/glossy/parse.js
View
@@ -136,12 +136,12 @@ GlossyParser.prototype.parse = function(rawMessage, callback) {
parsedMessage.appName = this.decideValue(segments.shift());
parsedMessage.pid = this.decideValue(segments.shift());
parsedMessage.msgID = this.decideValue(segments.shift());
-
+
if(segments[0] !== '-') {
var spliceMarker = 0;
- for (part in segments) {
- if(segments[part].substr(-1) === ']'){
- spliceMarker = part;
+ for (i = segments.length -1; i > -1; i--) {
+ if(segments[i].substr(-1) === ']'){
+ spliceMarker = i;
spliceMarker++;
break;
}

0 comments on commit a93920f

Please sign in to comment.