This is the mail archive of the guile@cygnus.com mailing list for the guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

`get-options.el': One more patch



 I think this one does it.  Hope I'm not a pest. :-)

Index: get-options.scm
===================================================================
RCS file: /usr/local/cvsroot/debian/guile-core/ice-9/get-options.scm,v
retrieving revision 1.6
diff -u -u -r1.6 get-options.scm
--- get-options.scm	1998/09/15 09:18:53	1.6
+++ get-options.scm	1998/09/15 16:07:44
@@ -208,7 +208,7 @@
 ;;;
 ;;;  `get-options' will never throw an error (barring bugs, of course)
 ;;;  except in the case where you've tried to specify an invalid
-;;;  option type.
+;;;  option type or an invalid option specifier string.
 ;;;
 ;;;  Please read the source; I'm proud of it. :-)
 ;;;
@@ -257,8 +257,15 @@
 		 (make-key-from-option-spec
 		  (lambda (spec-string)
 ;;		    (debug "make-key-from-option-spec, spec-string" spec-string)
-		    (if (eq? #\: (string-ref spec-string 1))
-			(string->symbol (substring spec-string 2))
+		    (if (and (> 1 (string-length spec-string))
+			     (eq? #\: (string-ref spec-string 1)))
+			(if (< 3 (string-length spec-string))
+			    (scm-error 'invalid-option-spec
+				       "get-options, make-key-from-option-spec"
+				       "Invalid option spec: %s"
+				       spec-string
+				       #f)
+			    (string->symbol (substring spec-string 2)))
 			(string->symbol spec-string))))
 		 (this-arg (car arg-ls)) (this-spec #f) (key #f) (keystring "") (val #f)
 		 (single-char-flag #f))
@@ -352,7 +359,11 @@
 			       (next-arg (cdr arg-ls)))
 
 			      (else
-			       (scm-error 'unknown-type "get-options" "Unknown argument type: ~s" (cadr this-spec))))
+			       (scm-error 'unknown-type
+					  "get-options"
+					  "Unknown argument type: %s"
+					  (cadr this-spec)
+					  #f)))
 			    )))
 		  ))
 	    ))))