Message-Id: <199612061026.TAA26424@mail.st.rim.or.jp> From: "Daisuke Aoyama" To: "DJGPP WORKERS" Subject: my fixes for libc (after bsh1147b.zip) Date: Fri, 6 Dec 1996 19:03:28 +0900 MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-2022-JP Content-Transfer-Encoding: 7bit corrected problems: hangs/craches when passing special name. breaks exception handlers when jumpping coff image. effects in multibyte characters (only I found for bash) Note: bash needs to call to mblen(replaced by libmb.a). Without applying this it crashes in my c:/windows. tminit.c is not included because it needs to be added a little. -------------------------------------------- --- src/libc/posix/sys/stat/fixpath.c Fri Dec 6 01:14:30 1996 +++ src/libc/posix/sys/stat/fixpath.c-orig Sat Oct 5 20:40:28 1996 @@ -81,7 +81,6 @@ char *op = out; int preserve_case = _preserve_fncase(); char *name_start; - int mbsize; use_lfn = _USE_LFN; @@ -150,22 +149,7 @@ /* Copy path component from in to out */ *op++ = '/'; -#if 0 while (!is_term(*ip)) *op++ = *ip++; -#else - while (!is_term(*ip)) - { - mbsize = mblen (ip, MB_CUR_MAX); - if (mbsize > 1) - { - /* copy multibyte character */ - while (--mbsize >= 0) - *op++ = *ip++; - } - else - *op++ = *ip++; - } -#endif } /* If root directory, insert trailing slash */ @@ -179,15 +163,6 @@ { char long_name[FILENAME_MAX], short_name[13]; -#if 1 - /* skip multibyte character */ - mbsize = mblen (op, MB_CUR_MAX); - if (mbsize > 1) - { - op += mbsize - 1; - continue; - } -#endif if (*op == '\\') *op = '/'; if (!preserve_case && (*op == '/' || *op == '\0')) @@ -196,24 +171,9 @@ long_name[op - name_start - 1] = '\0'; if (!strcmp(_lfn_gen_short_fname(long_name, short_name), long_name)) { -#if 0 while (++name_start < op) if (*name_start >= 'A' && *name_start <= 'Z') *name_start += 'a' - 'A'; -#else - while (++name_start < op) - { - mbsize = mblen (name_start, MB_CUR_MAX); - if (mbsize > 1) - { - /* skip multibyte character */ - name_start += mbsize - 1; - continue; - } - else if (*name_start >= 'A' && *name_start <= 'Z') - *name_start += 'a' - 'A'; - } -#endif } else name_start = op; --- src/stub/go32-v2.c Sat Nov 16 08:21:44 1996 +++ src/stub/go32-v2.c-orig Mon Aug 12 22:57:02 1996 @@ -373,23 +373,7 @@ } argv[0] = argv0; -#if 1 - { - extern __dpmi_paddr __djgpp_old_kbd; - __dpmi_paddr except; - - /* restore old handlers */ - __dpmi_get_protected_mode_interrupt_vector(9, &except); - if (__djgpp_old_kbd.offset32 != except.offset32 - || __djgpp_old_kbd.selector != except.selector) - __djgpp_exception_toggle (); - } -#endif longjmp(start_state, 0); -#if 1 - /* reset new handlers */ - __djgpp_exception_toggle (); -#endif return 0; } --- src/libc/dos/lfn/lfnshort.c Fri Dec 6 00:50:54 1996 +++ src/libc/dos/lfn/lfnshort.c-orig Sun Sep 1 13:44:46 1996 @@ -41,24 +41,12 @@ Convert to 8.3 filename. */ while (s - buf < 8 && *s && *s != ' ') *d++ = *s++; -#if 0 while (*s && *s == ' ') -#else - while (s - buf < 8 && *s && *s == ' ') -#endif s++; -#if 0 if (*s) -#else - if (*s != ' ') -#endif { *d++ = '.'; -#if 0 while (*s && *s != ' ') -#else - while (s - buf < 11 && *s && *s != ' ') -#endif *d++ = *s++; } *d = '\0'; --- src/libc/posix/dirent/readdir.c Thu Dec 5 19:15:10 1996 +++ src/libc/posix/dirent/readdir.c-orig Wed Sep 11 22:28:54 1996 @@ -1,6 +1,5 @@ /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */ #include -#include #include #include #include @@ -13,7 +12,6 @@ { int done; int oerrno = errno; - int mbsize; if (dir->need_fake_dot_dotdot) { @@ -51,24 +49,10 @@ if (!strcmp(_lfn_gen_short_fname(dir->ff.ff_name, fsh), dir->ff.ff_name)) for (cp=dir->ff.ff_name; *cp; cp++) -#if 1 - { - mbsize = mblen (cp, MB_CUR_MAX); - if (mbsize > 1) - { - cp += mbsize - 1; - continue; - } - else if (*cp >= 'A' && *cp <= 'Z') - *cp += 'a' - 'A'; - } -#else if (*cp >= 'A' && *cp <= 'Z') *cp += 'a' - 'A'; -#endif } strcpy(dir->de.d_name, dir->ff.ff_name); dir->de.d_namlen = strlen(dir->de.d_name); return &dir->de; } - -------------------------------------------- Daisuke Aoyama jack AT st DOT rim DOT or DOT jp