]> git.wincent.com - wikitext.git/commitdiff
_Wikitext_append_sanitized_link_target consistency changes
authorWincent Colaiuta <win@wincent.com>
Mon, 11 May 2009 23:08:43 +0000 (01:08 +0200)
committerWincent Colaiuta <win@wincent.com>
Mon, 11 May 2009 23:08:43 +0000 (01:08 +0200)
This makes the variable initialization order of the
_Wikitext_append_sanitized_link_target function match
that of the _Wikitext_trim_link_text function.

Signed-off-by: Wincent Colaiuta <win@wincent.com>
ext/parser.c

index 1e28f5290ec4d659f4c9ca4f52f4b32163a4cfe8..115001bbea457fd876c18ac10e1f761fb9158fc6 100644 (file)
@@ -748,10 +748,10 @@ void _Wikitext_trim_link_text(parser_t *parser)
 void _Wikitext_append_sanitized_link_target(parser_t *parser, str_t *output, bool trim)
 {
     char    *src        = parser->link_target->ptr;
-    char    *start      = src;  // remember this so we can check if we're at the start
+    char    *start      = src;                          // remember this so we can check if we're at the start
+    char    *non_space  = output->ptr + output->len;    // remember last non-space character output
     long    len         = parser->link_target->len;
     char    *end        = src + len;
-    char    *non_space  = output->ptr + output->len; // remember last non-space character output
     while (src < end)
     {
         // need at most 8 bytes to display each input character (&#x0000;)