Changeset 13311 in project


Ignore:
Timestamp:
02/15/09 08:47:46 (11 years ago)
Author:
Ivan Raikov
Message:

Changed read-form-fields to handle invalid fields.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • release/3/formular/trunk/formular.scm

    r12432 r13311  
    104104                            (stream-break (lambda (x) (char=? x field-delim)) strm)))
    105105                (let ((field-name ($ field-name))
    106                       (field-rest (stream-drop-while char-whitespace? (stream-cdr field-rest))))
     106                      (field-rest (and (not (stream-null? field-rest))
     107                                       (stream-drop-while char-whitespace? (stream-cdr field-rest)))))
     108                  (if (not field-rest)
     109                      (error 'read-form-fields "premature end of field" field-name))
    107110                  (let-values (((field-value rest) (read-field-value field-rest)))
    108111                     (loop (cons (list field-name field-value) fields)  rest)))))))))
Note: See TracChangeset for help on using the changeset viewer.