]> sjero.net Git - wget/blobdiff - src/url.c
--restrict-file-names=ascii
[wget] / src / url.c
index 2453157a617d0b4df79afe57a607ccf7644d4d04..afc31811d443378c7576a5eb17d6e919ba792298 100644 (file)
--- a/src/url.c
+++ b/src/url.c
@@ -1291,7 +1291,9 @@ enum {
   filechr_control     = 4       /* a control character, e.g. 0-31 */
 };
 
-#define FILE_CHAR_TEST(c, mask) (filechr_table[(unsigned char)(c)] & (mask))
+#define FILE_CHAR_TEST(c, mask) \
+    ((opt.restrict_files_nonascii && !c_isascii ((unsigned char)(c))) || \
+    (filechr_table[(unsigned char)(c)] & (mask)))
 
 /* Shorthands for the table: */
 #define U filechr_not_unix