about summary refs log tree commit diff stats
path: root/src/types
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2022-07-27 22:28:14 +0200
committerbptato <nincsnevem662@gmail.com>2022-07-27 23:26:24 +0200
commitdd9cb39c7d6adfa02feb181dd629bb9a93b7250c (patch)
tree4d4f840847a20577729f12a879c95c7a29a859b7 /src/types
parentcc92092fe8053f77d0c63e57c3990272b36be4ef (diff)
downloadchawan-dd9cb39c7d6adfa02feb181dd629bb9a93b7250c.tar.gz
Fix StyledNode invalidation & others
Diffstat (limited to 'src/types')
-rw-r--r--src/types/url.nim22
1 files changed, 10 insertions, 12 deletions
diff --git a/src/types/url.nim b/src/types/url.nim
index 4099fed9..afe7d83a 100644
--- a/src/types/url.nim
+++ b/src/types/url.nim
@@ -488,18 +488,16 @@ proc basicParseUrl*(input: string, base = none(Url), url: var Url = Url(), overr
         #TODO validation error
         if atsignseen:
           buffer = "%40" & buffer
-          atsignseen = true
-          var i = 0
-          while i < buffer.len:
-            if c == ':' and not passwordtokenseen:
-              passwordtokenseen = true
-              inc i
-              continue
-            if passwordtokenseen:
-              url.password.percentEncode(c, UserInfoPercentEncodeSet)
-            else:
-              url.username.percentEncode(c, UserInfoPercentEncodeSet)
-          buffer = ""
+        atsignseen = true
+        for c in buffer:
+          if c == ':' and not passwordtokenseen:
+            passwordtokenseen = true
+            continue
+          if passwordtokenseen:
+            url.password.percentEncode(c, UserInfoPercentEncodeSet)
+          else:
+            url.username.percentEncode(c, UserInfoPercentEncodeSet)
+        buffer = ""
       elif not has or c in {'/', '?', '#'} or (url.is_special and c == '\\'):
         if atsignseen and buffer == "":
           #TODO validation error