]> sjero.net Git - wget/blobdiff - src/res.c
[svn] Renamed wget.h XDIGIT-related macros to (hopefully) clearer names.
[wget] / src / res.c
index 6e3da1441a4ad049df1f352c9a3b6d7b62885d36..239666f6773036595dc5b8612cc4ee6dd5179318 100644 (file)
--- a/src/res.c
+++ b/src/res.c
@@ -417,17 +417,16 @@ free_specs (struct robot_specs *specs)
    that number is not a numerical representation of '/', decode C and
    advance the pointer.  */
 
-#define DECODE_MAYBE(c, ptr) do {                                      \
-  if (c == '%' && ISXDIGIT (ptr[1]) && ISXDIGIT (ptr[2]))              \
-    {                                                                  \
-      char decoded                                                     \
-       = (XCHAR_TO_XDIGIT (ptr[1]) << 4) + XCHAR_TO_XDIGIT (ptr[2]);   \
-      if (decoded != '/')                                              \
-       {                                                               \
-         c = decoded;                                                  \
-         ptr += 2;                                                     \
-       }                                                               \
-    }                                                                  \
+#define DECODE_MAYBE(c, ptr) do {                              \
+  if (c == '%' && ISXDIGIT (ptr[1]) && ISXDIGIT (ptr[2]))      \
+    {                                                          \
+      char decoded = X2DIGITS_TO_NUM (ptr[1], ptr[2]);         \
+      if (decoded != '/')                                      \
+       {                                                       \
+         c = decoded;                                          \
+         ptr += 2;                                             \
+       }                                                       \
+    }                                                          \
 } while (0)
 
 /* The inner matching engine: return non-zero if RECORD_PATH matches