diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/GridText.c | 7 | ||||
-rw-r--r-- | src/HTFWriter.c | 5 | ||||
-rw-r--r-- | src/LYExtern.c | 6 | ||||
-rw-r--r-- | src/LYMainLoop.c | 4 | ||||
-rw-r--r-- | src/LYUtils.c | 14 |
5 files changed, 14 insertions, 22 deletions
diff --git a/src/GridText.c b/src/GridText.c index e4490310..6cea9052 100644 --- a/src/GridText.c +++ b/src/GridText.c @@ -1,5 +1,5 @@ /* - * $LynxId: GridText.c,v 1.238 2012/08/03 17:28:03 tom Exp $ + * $LynxId: GridText.c,v 1.239 2012/08/15 22:20:41 tom Exp $ * * Character grid hypertext object * =============================== @@ -14646,7 +14646,7 @@ static int LYHandleCache(const char *arg, #ifdef USE_SOURCE_CACHE char *source_cache_file = NULL; #endif - long Size = 0; + off_t Size = 0; int x = -1; /* @@ -14760,7 +14760,8 @@ static int LYHandleCache(const char *arg, x, STR_LYNXCACHE, x, title, address, address); PUTS(buf); if (Size > 0) { - HTSprintf0(&buf, "Size: %ld ", Size); + HTSprintf0(&buf, "Size: %" PRI_off_t " ", Size); + PUTS(buf); } if (cachedoc != NULL && cachedoc->Lines > 0) { diff --git a/src/HTFWriter.c b/src/HTFWriter.c index 0a4154e7..dedb7bfa 100644 --- a/src/HTFWriter.c +++ b/src/HTFWriter.c @@ -1,5 +1,5 @@ /* - * $LynxId: HTFWriter.c,v 1.99 2011/06/11 12:15:28 tom Exp $ + * $LynxId: HTFWriter.c,v 1.100 2012/08/15 23:25:33 tom Exp $ * * FILE WRITER HTFWrite.h * =========== @@ -660,9 +660,6 @@ HTStream *HTSaveAndExecute(HTPresentation *pres, /* 1998/01/23 (Fri) 17:38:26 */ unsigned char *cp, *view_fname; -#define IS_SJIS_HI1(hi) ((0x81<=hi)&&(hi<=0x9F)) /* 1st lev. */ -#define IS_SJIS_HI2(hi) ((0xE0<=hi)&&(hi<=0xEF)) /* 2nd lev. */ - me->fp = NULL; view_fname = fnam + 3; diff --git a/src/LYExtern.c b/src/LYExtern.c index c6b64667..bbd0d545 100644 --- a/src/LYExtern.c +++ b/src/LYExtern.c @@ -1,5 +1,5 @@ /* - * $LynxId: LYExtern.c,v 1.49 2012/02/10 18:36:39 tom Exp $ + * $LynxId: LYExtern.c,v 1.50 2012/08/15 23:16:22 tom Exp $ * External application support. This feature allows lynx to pass a given URL to an external program. @@ -31,8 +31,8 @@ #ifdef WIN_EX /* ASCII char -> HEX digit */ -#define ASC2HEXD(x) (((x) >= '0' && (x) <= '9') ? \ - ((x) - '0') : (toupper(x) - 'A' + 10)) +#define ASC2HEXD(x) ((UCH(x) >= '0' && UCH(x) <= '9') ? \ + (UCH(x) - '0') : (toupper(UCH(x)) - 'A' + 10)) /* Decodes the forms %xy in a URL to the character the hexadecimal code of which is xy. xy are hexadecimal digits from diff --git a/src/LYMainLoop.c b/src/LYMainLoop.c index d1520d51..0584f9a5 100644 --- a/src/LYMainLoop.c +++ b/src/LYMainLoop.c @@ -1,5 +1,5 @@ /* - * $LynxId: LYMainLoop.c,v 1.210 2012/07/07 16:28:47 tom Exp $ + * $LynxId: LYMainLoop.c,v 1.211 2012/08/15 23:18:03 tom Exp $ */ #include <HTUtils.h> #include <HTAccess.h> @@ -116,7 +116,7 @@ static char *str_sjis(char *to, char *from) strcpy(to, from); #endif } else { - TO_SJIS(from, to); + TO_SJIS((unsigned char *) from, (unsigned char *) to); } return to; } 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) |