summaryrefslogtreecommitdiff
path: root/src/util.lisp
diff options
context:
space:
mode:
Diffstat (limited to 'src/util.lisp')
-rw-r--r--src/util.lisp14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/util.lisp b/src/util.lisp
index 08f9936..3494493 100644
--- a/src/util.lisp
+++ b/src/util.lisp
@@ -21,14 +21,12 @@ BUGS:
(when *debug* (format t "start-tag ~A~%, end-tag ~A~%" start-tag end-tag))
(do ((c (funcall reader 1) (funcall reader 1)))
((or (null c) (and storing-p (= match-count (length end-tag))))
- (if (null c)
- nil
- (subseq acc 0 (- (length acc) (length end-tag)))))
+ (if (null c) nil acc))
(when *debug* (format t "looking at ~A~%" c))
+ (vector-push-extend c acc)
(if storing-p
(progn
(when *debug* (format t "pushing it~%"))
- (vector-push-extend c acc)
(if (eql c (char-code (aref end-tag match-count)))
(incf match-count)
(setf match-count 0))
@@ -37,14 +35,12 @@ BUGS:
(if (eql c (char-code #\>)) ; looking for '>'
(setf storing-p t))
(progn
- (when (and *debug* nil)
- (format t "XXX ~A ~A " (aref start-tag match-count)
- (eql c (char-code (aref start-tag match-count)))))
(if (eql c (char-code (aref start-tag match-count))) ; looking for start-tag
(incf match-count)
- (setf match-count 0))
+ (progn
+ (setf match-count 0)
+ (setf (fill-pointer acc) 0))) ; discard
(when *debug* (format t "match-count ~A~%" match-count))))))))
-
(let ((sock nil))
(defun new-reader (host port)