about summary refs log tree commit diff stats
path: root/src/LYUtils.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/LYUtils.c')
-rw-r--r--src/LYUtils.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/src/LYUtils.c b/src/LYUtils.c
index 8a7d0800..a82e30c2 100644
--- a/src/LYUtils.c
+++ b/src/LYUtils.c
@@ -1,5 +1,5 @@
 /*
- * $LynxId: LYUtils.c,v 1.225 2012/08/03 17:38:47 tom Exp $
+ * $LynxId: LYUtils.c,v 1.227 2012/08/15 23:11:03 tom Exp $
  */
 #include <HTUtils.h>
 #include <HTTCP.h>
@@ -7965,13 +7965,10 @@ static char *device_list[] =
     NULL
 };
 
-#define IS_SJIS_HI1(hi) ((0x81<=hi)&&(hi<=0x9F))	/* 1st lev. */
-#define IS_SJIS_HI2(hi) ((0xE0<=hi)&&(hi<=0xEF))	/* 2nd lev. */
-
 int unsafe_filename(const char *fname)
 {
     int i, len, sum;
-    unsigned char *cp;
+    char *cp;
     char *save;
 
     i = 0;
@@ -7985,7 +7982,7 @@ int unsafe_filename(const char *fname)
     save = cp = strdup(fname);
 
     while (*cp) {
-	if (IS_SJIS_HI1(*cp) || IS_SJIS_HI2(*cp))
+	if (IS_SJIS_HI1(UCH(*cp)) || IS_SJIS_HI2(UCH(*cp)))
 	    cp += 2;		/* KANJI skip */
 	if (IS_SEP(*cp)) {
 	    *cp = '\0';
@@ -8017,10 +8014,7 @@ int unsafe_filename(const char *fname)
     }
     free(save);
 
-    if (sum != 0)
-	return 1;
-    else
-	return 0;
+    return (sum != 0);
 }
 
 FILE *safe_fopen(const char *fname, const char *mode)
3' href='#n143'>143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238