Code

Resolves the year 1 problem on the calendar render extension.
[inkscape.git] / share / extensions / simplepath.rb
index 0b6e122bf926f8497d5d1c3a9fa3165d2620a110..3d9b7b372142f823d406cb25db5a487d9475f16c 100755 (executable)
@@ -78,6 +78,8 @@ def parsePath(d)
     lastCommand = nil
 
     lexPath(d) do |token, isCommand|
+        raise 'Invalid number of parameters' if command and isCommand
+
         unless command
             if isCommand
                 raise 'Invalid path, must begin with moveto.' \
@@ -94,8 +96,9 @@ def parsePath(d)
                 end
             end
             outputCommand = command.upcase
-        else
-            raise 'Invalid number of parameters' if isCommand
+        end
+
+        unless isCommand
             param = token.send PATHDEFS[outputCommand].casts[params.length]
             if command =~ /[a-z]/
                 case PATHDEFS[outputCommand].coord_types[params.length]