--- rsvg-path.c	2010-06-05 01:25:34.000000000 -0400
+++ rsvg-path.c	2010-06-05 03:42:23.000000000 -0400
@@ -494,26 +494,38 @@
                 exp_sign = 1;
                 exp_wait_sign = FALSE;
                 val = c - '0';
                 sign = 1;
             }
         } else if (c == '.') {
-	    if (in_frac) {
-	      rsvg_path_end_of_number(ctx, val, sign, exp_sign, exp);
+            /* in_frac means we're creating a *new* number (3.5.7 is 3.5 0.7).
+             * !in_num means we're creating *a* number (L.6,1 is L 0.6 1).
+             */
+	    if (in_frac || !in_num) {
+              if (in_frac) {
+	          rsvg_path_end_of_number(ctx, val, sign, exp_sign, exp);
+              }
 	      in_num = TRUE;
-	      in_frac = FALSE;
 	      in_exp = FALSE;
 	      exp = 0;
 	      exp_sign = 1;
 	      exp_wait_sign = FALSE;
 	      val = 0;
 	      sign = 1;
 	    }
 	    else if (!in_num) {
                 in_num = TRUE;
+                in_exp = FALSE;
+                exp = 0;
+                exp_sign = 1;
+                exp_wait_sign = FALSE;
                 val = 0;
+                /* guaranteed to be positive here, since -.5 would have gone
+                 * to the - case first, setting in_num to TRUE!
+                 */
+                sign = 1;
             }
             in_frac = TRUE;
             frac = 1;
         } else if ((c == 'E' || c == 'e') && in_num) {
             in_exp = TRUE;
             exp_wait_sign = TRUE;
@@ -522,12 +534,15 @@
         } else if ((c == '+' || c == '-') && in_exp) {
             exp_sign = c == '+' ? 1 : -1;
         } else if (in_num) {
             /* end of number */
 	    rsvg_path_end_of_number(ctx, val, sign, exp_sign, exp);
 	    in_num = FALSE;
+            /* *really* end the number, fixes GNOME bug 620565 */
+            in_frac = FALSE;
+            in_exp = FALSE;
         }
 
         if (c == '\0')
             break;
         else if ((c == '+' || c == '-') && !exp_wait_sign) {
             sign = c == '+' ? 1 : -1;
