X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=src%2Fheader.c;fp=src%2Fheader.c;h=5b710b9c62d8a8e6e425161ec22b0ded37137786;hb=c603eaa42cff3b74661d8603069421c064975b10;hp=fa544f37fdd13e69e7e8cd2f4e8113808ef2b925;hpb=c9d093d3f657e384bc0927f1816572c3c5341c1a;p=lha%2Flha.git diff --git a/src/header.c b/src/header.c index fa544f3..5b710b9 100644 --- a/src/header.c +++ b/src/header.c @@ -279,9 +279,15 @@ convert_filename(name, len, size, } if (from_code == CODE_SJIS && to_code == CODE_UTF8) { - for (i = 0; i < len; i++) - /* FIXME: provisionally fix for the Mac OS CoreFoundation */ - if ((unsigned char)name[i] == LHA_PATHSEP) name[i] = '/'; + for (i = 0; i < len; i++) { + if (SJIS_FIRST_P(name[i]) && SJIS_SECOND_P(name[i+1])) + i++; + else { + /* FIXME: provisionally fix for the Mac OS CoreFoundation */ + if (strchr(from_delim, name[i])) + name[i] = '/'; + } + } sjis_to_utf8(tmp, name, sizeof(tmp)); strncpy(name, tmp, size); name[size-1] = 0; @@ -1337,7 +1343,6 @@ copy_path_element(char *dst, const char *src, int size) static int canon_path(char *newpath, char *path, size_t size) { - int len; char *p = newpath; path = remove_leading_dots(path);