しらいです。

 file & directory 管理ツール FDclone 2.08e の patch その 4
です。

Submitted-by: shirai@chandra2
Archive-name: FD-2.08e.patch/part04

---- Cut Here and feed the following to sh ----
#!/bin/sh
# This is `FD-2.08e.shar.04' (part 4 of FD-2.08e.patch).
# Do not concatenate these parts, unpack them in order with `/bin/sh'.
# File `FD-2.08e.patch' is being continued...
#
echo=echo
touch -am 1231235999 $$.touch >/dev/null 2>&1
if test ! -f 1231235999 && test -f $$.touch; then
  shar_touch=touch
else
  shar_touch=:
  echo
  $echo 'WARNING: not restoring timestamps.  Consider getting and'
  $echo "installing GNU \`touch', distributed in GNU File Utilities..."
  echo
fi
rm -f 1231235999 $$.touch
#
if test ! -r _sh01537/seq; then
  $echo 'Please unpack part 1 first!'
  exit 1
fi
shar_sequence=`cat _sh01537/seq`
if test "$shar_sequence" != 4; then
  $echo 'Please unpack part' "$shar_sequence" 'next!'
  exit 1
fi
if test ! -f _sh01537/new; then
  $echo 'x -' 'STILL SKIPPING' 'FD-2.08e.patch'
else
  $echo 'x -' 'continuing file' 'FD-2.08e.patch'
  sed 's/^X//' << 'SHAR_EOF' >> FD-2.08e.patch &&
+                       len = 1;
+                       if (mode != ASCII) len += 3;
+                       if (j + len > max) break;
X                       if (mode != ASCII) {
X                               buf[j++] = '\033';
X                               buf[j++] = '(';
@@ -1318,8 +1331,9 @@
X       return(j);
X }
X 
+# ifdef        _USEUNICODE
X static VOID NEAR ucs2normalization(buf, ptrp, max, wc, nf)
-u_int *buf;
+u_short *buf;
X int *ptrp, max;
X u_int wc;
X int nf;
@@ -1332,7 +1346,7 @@
X       ofs = ent = 0;
X       if (unicodebuffer && !nftblbuf) readunitable(1);
X 
-       if (wc < MINUNICODE || wc > MAXUNICODE);
+       if (wc < MINUNICODE || wc > MAXUNICODE) /*EMPTY*/;
X       else if (nftblbuf && nf <= nftblnum) {
X               n = 2 + nflen * 2;
X               cp = nftblbuf[nf - 1];
@@ -1368,12 +1382,12 @@
X }
X 
X static u_int NEAR ucs2denormalization(buf, ptrp, nf)
-u_int *buf;
+u_short *buf;
X int *ptrp, nf;
X {
X       u_char *cp, *new;
X       off_t top;
-       u_int w, min, max, ofs, ent;
+       u_int w, ofs, min, max, ent;
X       int i, j, n, fd;
X 
X       cp = new = NULL;
@@ -1381,66 +1395,54 @@
X       i = 0;
X       if (unicodebuffer && !nftblbuf) readunitable(1);
X 
-       if (buf[*ptrp] < MINUNICODE || buf[*ptrp] > MAXUNICODE);
+       if (buf[*ptrp] < MINUNICODE || buf[*ptrp] > MAXUNICODE) /*EMPTY*/;
X       else if (nftblbuf && nf <= nftblnum) {
X               n = 2 + nflen * 2;
+               min = 0;
X               max = nftblent[nf - 1] + 1;
-               ofs = nftblent[nf - 1] / 2 + 1;
X               for (;;) {
-                       if (ofs == min || ofs == max) break;
+                       ofs = (min + max) / 2;
+                       if (ofs <= min || ofs >= max) break;
X                       cp = &(nftblbuf[nf - 1][(ofs - 1) * n]);
X                       w = 0xffff;
X                       for (i = 0, j = 2; i < nflen; i++, j += 2) {
-                               w = getword(cp, j);
-                               if (!w) break;
-                               if (buf[*ptrp + i] != w) break;
+                               if (!(w = getword(cp, j))) /*EMPTY*/;
+                               else if (buf[*ptrp + i] > w) min = ofs;
+                               else if (buf[*ptrp + i] < w) max = ofs;
+                               else continue;
+                               break;
X                       }
X                       if (!w) break;
-                       else if (buf[*ptrp + i] < w) {
-                               max = ofs;
-                               ofs = (ofs + min) / 2;
-                       }
-                       else {
-                               min = ofs;
-                               ofs = (ofs + max) / 2;
-                       }
X               }
X       }
X       else if ((fd = opennftbl(UNICODETBL, nf, &ent)) < 0
-       || (top = Xlseek(fd, (off_t)0, L_INCR)) < (off_t)0)
+       || (top = lseek(fd, (off_t)0, L_INCR)) < (off_t)0)
X               /*EMPTY*/;
X       else {
X               n = 2 + nflen * 2;
X               cp = new = (u_char *)malloc2(n);
+               min = 0;
X               max = ent + 1;
-               ofs = ent / 2 + 1;
X               for (;;) {
-                       if (ofs == min || ofs == max) break;
-                       if (Xlseek(fd, (off_t)(ofs - 1) * n + top, L_SET)
-                       < (off_t)0
-                       || read(fd, cp, n) != n) {
+                       ofs = (min + max) / 2;
+                       if (ofs <= min || ofs >= max) break;
+                       if (!skread(fd, (off_t)(ofs - 1) * n + top, cp, n)) {
X                               ofs = min = max = 0;
X                               break;
X                       }
X                       w = 0xffff;
X                       for (i = 0, j = 2; i < nflen; i++, j += 2) {
-                               w = getword(cp, j);
-                               if (!w) break;
-                               if (buf[*ptrp + i] != w) break;
+                               if (!(w = getword(cp, j))) /*EMPTY*/;
+                               else if (buf[*ptrp + i] > w) min = ofs;
+                               else if (buf[*ptrp + i] < w) max = ofs;
+                               else continue;
+                               break;
X                       }
X                       if (!w) break;
-                       else if (buf[*ptrp + i] < w) {
-                               max = ofs;
-                               ofs = (ofs + min) / 2;
-                       }
-                       else {
-                               min = ofs;
-                               ofs = (ofs + max) / 2;
-                       }
X               }
X       }
X 
-       if (ofs == min || ofs == max) w = buf[(*ptrp)++];
+       if (ofs <= min || ofs >= max) w = buf[(*ptrp)++];
X       else {
X               w = getword(cp, 0);
X               *ptrp += i;
@@ -1456,27 +1458,23 @@
X {
X       u_int w;
X 
+       if (iskanji1((char *)s, *ptrp)) {
X # ifdef       CODEEUC
-       if (iseuc(s[*ptrp]) && iseuc(s[*ptrp + 1])) {
X               u_char tmp[2];
X 
X               j2sj((char *)tmp, &(s[*ptrp]));
X               if (kanjierrno) kanjierrno = EUC;
X               *ptrp += 2;
X               w = (((u_int)(tmp[0]) << 8) | tmp[1]);
-       }
-       else if (isekana(s, *ptrp)) {
-               w = s[++(*ptrp)];
-               (*ptrp)++;
-       }
X # else
-       if (issjis1(s[*ptrp]) && issjis2(s[*ptrp + 1])) {
X               w = (((u_int)(s[*ptrp]) << 8) | s[*ptrp + 1]);
X               *ptrp += 2;
-       }
-       else if (isskana(s, *ptrp)) w = s[(*ptrp)++];
X # endif
-       else w = s[(*ptrp)++];
+       }
+       else {
+               VOID_C iskana1((char *)s, ptrp);
+               w = s[(*ptrp)++];
+       }
X 
X       return(cnvunicode(w, 1));
X }
@@ -1514,41 +1512,45 @@
X       else buf[(*ptrp)++] = wc;
X }
X 
-static VOID NEAR ucs2toutf8(buf, ptrp, wc)
+int ucs2toutf8(buf, ptr, wc)
X char *buf;
-int *ptrp;
+int ptr;
X u_int wc;
X {
-       if (wc < 0x80) buf[(*ptrp)++] = wc;
+       if (wc < 0x80) buf[ptr++] = wc;
X       else if (wc < 0x800) {
-               buf[(*ptrp)++] = 0xc0 | (wc >> 6);
-               buf[(*ptrp)++] = 0x80 | (wc & 0x3f);
+               buf[ptr++] = 0xc0 | (wc >> 6);
+               buf[ptr++] = 0x80 | (wc & 0x3f);
X       }
X       else {
-               buf[(*ptrp)++] = 0xe0 | (wc >> 12);
-               buf[(*ptrp)++] = 0x80 | ((wc >> 6) & 0x3f);
-               buf[(*ptrp)++] = 0x80 | (wc & 0x3f);
+               buf[ptr++] = 0xe0 | (wc >> 12);
+               buf[ptr++] = 0x80 | ((wc >> 6) & 0x3f);
+               buf[ptr++] = 0x80 | (wc & 0x3f);
X       }
+
+       return(ptr);
X }
X 
-static u_int NEAR ucs2fromutf8(s, ptrp)
+u_int ucs2fromutf8(s, ptrp)
X u_char *s;
X int *ptrp;
X {
X       u_int w;
+       int ptr;
X 
-       w = s[(*ptrp)++];
-       if (w < 0x80);
-       else if (isutf2(w, s[*ptrp]))
-               w = ((w & 0x1f) << 6) | (s[(*ptrp)++] & 0x3f);
-       else if (isutf3(w, s[*ptrp], s[*ptrp + 1])) {
-               w = ((w & 0x0f) << 6) | (s[(*ptrp)++] & 0x3f);
-               w = (w << 6) | (s[(*ptrp)++] & 0x3f);
+       ptr = (ptrp) ? *ptrp : 0;
+       w = s[ptr++];
+       if (w < 0x80) /*EMPTY*/;
+       else if (isutf2(w, s[ptr])) w = ((w & 0x1f) << 6) | (s[ptr++] & 0x3f);
+       else if (isutf3(w, s[ptr], s[ptr + 1])) {
+               w = ((w & 0x0f) << 6) | (s[ptr++] & 0x3f);
+               w = (w << 6) | (s[ptr++] & 0x3f);
X       }
X       else {
X               w = U2_UDEF;
X               kanjierrno = UTF8;
X       }
+       if (ptrp) *ptrp = ptr;
X 
X       return(w);
X }
@@ -1558,10 +1560,18 @@
X u_char *s;
X int max;
X {
-       int i, j;
+       u_int c;
+       int i, j, len;
X 
X       i = j = 0;
-       while (s[i] && j < max - 3) ucs2toutf8(buf, &j, toucs2(s, &i));
+       while (s[i] && j < max) {
+               c = toucs2(s, &i);
+               len = 1;
+               if (c >= 0x80) len++;
+               if (c >= 0x800) len++;
+               if (j + len > max) break;
+               j = ucs2toutf8(buf, j, c);
+       }
X       cnvunicode(0, -1);
X       if (kanjierrno) kanjierrno = DEFCODE;
X 
@@ -1576,7 +1586,7 @@
X       int i, j;
X 
X       i = j = 0;
-       while (s[i] && j < max - 2) fromucs2(buf, &j, ucs2fromutf8(s, &i));
+       while (s[i] && j + 1 < max) fromucs2(buf, &j, ucs2fromutf8(s, &i));
X       cnvunicode(0, -1);
X 
X       return(j);
@@ -1587,18 +1597,24 @@
X u_char *s;
X int max, nf;
X {
-       u_int *u1, *u2;
-       int i, j;
+       u_short *u1, *u2;
+       int i, j, len;
X 
-       u1 = (u_int *)malloc2((max + 1) * sizeof(u_int));
-       u2 = (u_int *)malloc2((max + 1) * sizeof(u_int));
+       u1 = (u_short *)malloc2((max + 1) * sizeof(u_short));
+       u2 = (u_short *)malloc2((max + 1) * sizeof(u_short));
X 
X       for (i = j = 0; s[i] && j < max; j++) u1[j] = toucs2(s, &i);
X       u1[j] = 0;
X       for (i = j = 0; u1[i] && j < max; i++)
X               ucs2normalization(u2, &j, max, u1[i], nf);
X       u2[j] = 0;
-       for (i = j = 0; u2[i] && j < max - 3; i++) ucs2toutf8(buf, &j, u2[i]);
+       for (i = j = 0; u2[i] && j < max; i++) {
+               len = 1;
+               if (u2[i] >= 0x80) len++;
+               if (u2[i] >= 0x800) len++;
+               if (j + len > max) break;
+               j = ucs2toutf8(buf, j, u2[i]);
+       }
X 
X       free(u1);
X       free(u2);
@@ -1613,18 +1629,18 @@
X u_char *s;
X int max, nf;
X {
-       u_int *u1, *u2;
+       u_short *u1, *u2;
X       int i, j;
X 
-       u1 = (u_int *)malloc2((max + 1) * sizeof(u_int));
-       u2 = (u_int *)malloc2((max + 1) * sizeof(u_int));
+       u1 = (u_short *)malloc2((max + 1) * sizeof(u_short));
+       u2 = (u_short *)malloc2((max + 1) * sizeof(u_short));
X 
X       for (i = j = 0; s[i] && j < max; j++) u1[j] = ucs2fromutf8(s, &i);
X       u1[j] = 0;
X       for (i = j = 0; u1[i] && j < max; j++)
X               u2[j] = ucs2denormalization(u1, &i, nf);
X       u2[j] = 0;
-       for (i = j = 0; u2[i] && j < max - 2; i++) fromucs2(buf, &j, u2[i]);
+       for (i = j = 0; u2[i] && j + 1 < max; i++) fromucs2(buf, &j, u2[i]);
X 
X       free(u1);
X       free(u2);
@@ -1632,6 +1648,7 @@
X 
X       return(j);
X }
+# endif        /* _USEUNICODE */
X 
X static int NEAR bin2hex(buf, c)
X char *buf;
@@ -1652,25 +1669,27 @@
X u_char *s;
X int max;
X {
+# ifdef        CODEEUC
+       u_char tmp[2];
+# endif
X       int i, j;
X 
-       for (i = j = 0; s[i] && j < max - 2; i++, j++) {
+       for (i = j = 0; s[i] && j < max; i++, j++) {
+               if (iskanji1((char *)s, i)) {
+                       if (j + 6 > max) break;
X # ifdef       CODEEUC
-               if (iseuc(s[i]) && iseuc(s[i + 1])) {
-                       u_char tmp[2];
-
X                       j2sj((char *)tmp, &(s[i++]));
X                       j += bin2hex(&(buf[j]), tmp[0]);
X                       j += bin2hex(&(buf[j]), tmp[1]) - 1;
-               }
-               else if (isekana(s, i)) j += bin2hex(&(buf[j]), s[++i]) - 1;
X # else
-               if (issjis1(s[i]) && issjis2(s[i + 1])) {
X                       j += bin2hex(&(buf[j]), s[i++]);
X                       j += bin2hex(&(buf[j]), s[i]) - 1;
-               }
-               else if (isskana(s, i)) j += bin2hex(&(buf[j]), s[i]) - 1;
X # endif
+               }
+               else if (iskana1((char *)s, &i)) {
+                       if (j + 3 > max) break;
+                       j += bin2hex(&(buf[j]), s[i]) - 1;
+               }
X               else buf[j] = s[i];
X       }
X       if (kanjierrno) kanjierrno = DEFCODE;
@@ -1685,18 +1704,20 @@
X {
X       int i, j, c1, c2;
X 
-       for (i = j = 0; s[i] && j < max - 1; i++, j++) {
+       for (i = j = 0; s[i] && j < max; i++, j++) {
X               if (!ishex(s, i)) buf[j] = s[i];
X               else {
X                       c1 = tobin2(s, i + 1);
X                       i += 2;
X                       if (iskana2(c1)) {
X # ifdef       CODEEUC
+                               if (j + 2 > max) break;
X                               buf[j++] = (char)C_EKANA;
X # endif
X                               buf[j] = c1;
X                       }
X                       else if (issjis1(c1)) {
+                               if (j + 2 > max) break;
X                               i++;
X                               if (!ishex(s, i)) c2 = s[i];
X                               else {
@@ -1751,25 +1772,31 @@
X u_char *s;
X int max;
X {
-       int i, j;
-
-       for (i = j = 0; s[i] && j < max - 2; i++, j++) {
X # ifdef       CODEEUC
-               if (iseuc(s[i]) && iseuc(s[i + 1])) {
-                       u_char tmp[2];
+       u_char tmp[2];
+# endif
+       int i, j, len;
X 
+       for (i = j = 0; s[i] && j < max; i++, j++) {
+               if (iskanji1((char *)s, i)) {
+                       len = 4;
+# ifdef        CODEEUC
X                       j2sj((char *)tmp, &(s[i++]));
+                       if (ismsb(tmp[1])) len += 2;
+                       if (j + len > max) break;
X                       j += bin2cap(&(buf[j]), tmp[0]);
X                       j += bin2cap(&(buf[j]), tmp[1]) - 1;
-               }
-               else if (isekana(s, i)) j += bin2cap(&(buf[j]), s[++i]) - 1;
X # else
-               if (issjis1(s[i]) && issjis2(s[i + 1])) {
+                       if (ismsb(s[i + 1])) len += 2;
+                       if (j + len > max) break;
X                       j += bin2cap(&(buf[j]), s[i++]);
X                       j += bin2cap(&(buf[j]), s[i]) - 1;
-               }
-               else if (isskana(s, i)) j += bin2cap(&(buf[j]), s[i]) - 1;
X # endif
+               }
+               else if (iskana1((char *)s, &i)) {
+                       if (j + 3 > max) break;
+                       j += bin2cap(&(buf[j]), s[i]) - 1;
+               }
X               else buf[j] = s[i];
X       }
X       if (kanjierrno) kanjierrno = DEFCODE;
@@ -1784,18 +1811,20 @@
X {
X       int i, j, c1, c2;
X 
-       for (i = j = 0; s[i] && j < max - 1; i++, j++) {
+       for (i = j = 0; s[i] && j < max; i++, j++) {
X               if (!iscap(s, i)) buf[j] = s[i];
X               else {
X                       c1 = tobin2(s, i + 1);
X                       i += 2;
X                       if (iskana2(c1)) {
X # ifdef       CODEEUC
+                               if (j + 2 > max) break;
X                               buf[j++] = (char)C_EKANA;
X # endif
X                               buf[j] = c1;
X                       }
X                       else if (issjis1(c1)) {
+                               if (j + 2 > max) break;
X                               i++;
X                               if (!iscap(s, i)) c2 = s[i];
X                               else {
@@ -1857,12 +1886,14 @@
X               case O_JUNET:
X                       *lenp = tojunet(buf, (u_char *)s, max, '@', 'J', io);
X                       break;
+# ifdef        _USEUNICODE
X               case UTF8:
X                       *lenp = toutf8(buf, (u_char *)s, max);
X                       break;
X               case M_UTF8:
-                       *lenp = toutf8nf(buf, (u_char *)s, max, NF_MAC);
+                       *lenp = toutf8nf(buf, (u_char *)s, max, out - UTF8);
X                       break;
+# endif
X               case HEX:
X                       *lenp = tohex(buf, (u_char *)s, max);
X                       break;
@@ -1883,14 +1914,16 @@
X                                       *lenp = fromjis(buf, (u_char *)s,
X                                               max, io);
X                                       break;
+# ifdef        _USEUNICODE
X                               case UTF8:
X                                       *lenp = fromutf8(buf, (u_char *)s,
X                                               max);
X                                       break;
X                               case M_UTF8:
X                                       *lenp = fromutf8nf(buf, (u_char *)s,
-                                               max, NF_MAC);
+                                               max, in - UTF8);
X                                       break;
+# endif
X                               case HEX:
X                                       *lenp = fromhex(buf, (u_char *)s, max);
X                                       break;
@@ -1948,9 +1981,9 @@
X       char *buf;
X       int len;
X 
-       if (!s) return(NULL);
+       if (!s) return(s);
X       len = strlen(s) * 3 + 3;
-       buf = malloc2(len + 1);
+       if (!(buf = malloc(len + 1))) return(s);
X       if (kanjiconv2(buf, s, len, in, out, io) != buf) {
X               free(buf);
X               return(s);
@@ -1960,13 +1993,13 @@
X }
X #endif        /* !_NOKANJICONV */
X 
-#ifndef        _NOKANJIFCONV
+#if    defined (FD) && !defined (_NOKANJIFCONV)
X int getkcode(path)
X char *path;
X {
X       int i;
X 
-# if   defined (FD) && defined (_NODOSEMU)
+# ifdef        _USEDOSEMU
X       if (_dospath(path)) return(SJIS);
X # endif
X       for (i = 0; i < MAXKPATHLIST; i++) {
@@ -1976,7 +2009,7 @@
X 
X       return(fnamekcode);
X }
-#endif /* !_NOKANJIFCONV */
+#endif /* FD && !_NOKANJIFCONV */
X 
X #ifndef       _NOKANJICONV
X int getoutputkcode(VOID_A)
@@ -1988,50 +2021,51 @@
X }
X #endif        /* !_NOKANJICONV */
X 
+#ifdef FD
X /*ARGSUSED*/
X char *convget(buf, path, dos)
X char *buf, *path;
X int dos;
X {
-#if    defined (FD) && !defined (_NOROCKRIDGE)
+# ifndef       _NOROCKRIDGE
X       char rbuf[MAXPATHLEN];
-#endif
-#ifndef        _NOKANJIFCONV
+# endif
+# ifndef       _NOKANJIFCONV
X       int fgetok;
-#endif
+# endif
X       char *cp;
X 
X       if (noconv) return(path);
-#ifndef        _NOKANJIFCONV
+# ifndef       _NOKANJIFCONV
X       fgetok = (nokanjifconv) ? 0 : 1;
-#endif
+# endif
X 
X       cp = path;
-#if    defined (FD) && !defined (_NOROCKRIDGE)
+# ifndef       _NOROCKRIDGE
X       if (!norockridge) cp = transpath(cp, rbuf);
-#endif
-#if    defined (FD) && defined (_NODOSEMU)
+# endif
+# ifdef        _USEDOSEMU
X       if (dos) {
-# ifdef        CODEEUC
+#  ifdef       CODEEUC
X               buf[sjis2ujis(buf, (u_char *)cp, MAXPATHLEN - 1)] = '\0';
X               cp = buf;
-# endif
-# ifndef       _NOKANJIFCONV
+#  endif
+#  ifndef      _NOKANJIFCONV
X               fgetok = 0;
-# endif
+#  endif
X       }
-#endif /* FD && _USEDOSEMU */
-#ifndef        _NOKANJIFCONV
+# endif        /* _USEDOSEMU */
+# ifndef       _NOKANJIFCONV
X       if (fgetok)
X               cp = kanjiconv2(buf, cp,
X                       MAXPATHLEN - 1, getkcode(cp), DEFCODE, L_FNAME);
-#endif
-#if    defined (FD) && !defined (_NOROCKRIDGE)
+# endif
+# ifndef       _NOROCKRIDGE
X       if (cp == rbuf) {
X               strcpy(buf, rbuf);
X               return(buf);
X       }
-#endif
+# endif
X 
X       return(cp);
X }
@@ -2043,15 +2077,15 @@
X char *rrreal;
X int *codep;
X {
-#if    !defined (_NOKANJIFCONV) || (defined (FD) && defined (_USEDOSEMU))
+# if   !defined (_NOKANJIFCONV) || defined (_USEDOSEMU)
X       char kbuf[MAXPATHLEN];
-#endif
-#if    defined (FD) && !defined (_NOROCKRIDGE)
+# endif
+# ifndef       _NOROCKRIDGE
X       char rbuf[MAXPATHLEN];
-#endif
-#ifndef        _NOKANJIFCONV
+# endif
+# ifndef       _NOKANJIFCONV
X       int c, fputok;
-#endif
+# endif
X       char *cp, *file, rpath[MAXPATHLEN];
X       int n;
X 
@@ -2059,35 +2093,29 @@
X       if (codep) *codep = NOCNV;
X 
X       if (noconv || isdotdir(path)) {
-#if    defined (FD) && defined (_USEDOSEMU)
+# ifdef        _USEDOSEMU
X               if (dospath(path, buf)) return(buf);
-#endif
+# endif
X               return(path);
X       }
-#ifndef        _NOKANJIFCONV
+# ifndef       _NOKANJIFCONV
X       fputok = (nokanjifconv) ? 0 : 1;
-#endif
+# endif
X 
X       if (needfile && strdelim(path, 0)) needfile = 0;
-#ifdef FD
X       if (norealpath) cp = path;
-       else
-#endif
-       {
+       else {
X               if ((file = strrdelim(path, 0))) {
X                       n = file - path;
X                       if (file++ == isrootdir(path)) n++;
X                       strncpy2(rpath, path, n);
X               }
-#if    defined (FD) && defined (_USEDOSEMU)
+# ifdef        _USEDOSEMU
X               else if ((n = _dospath(path))) {
X                       file = path + 2;
-                       rpath[0] = n;
-                       rpath[1] = ':';
-                       rpath[2] = '.';
-                       rpath[3] = '\0';
+                       VOID_C gendospath(rpath, n, '.');
X               }
-#endif
+# endif
X               else {
X                       file = path;
X                       copycurpath(rpath);
@@ -2097,23 +2125,23 @@
X               strncpy2(cp, file, MAXPATHLEN - 1 - (cp - rpath));
X               cp = rpath;
X       }
-#if    defined (FD) && defined (_USEDOSEMU)
+# ifdef        _USEDOSEMU
X       if ((n = dospath(cp, kbuf))) {
X               cp = kbuf;
X               if (codep) *codep = SJIS;
-# ifndef       _NOKANJIFCONV
+#  ifndef      _NOKANJIFCONV
X               fputok = 0;
-# endif
+#  endif
X       }
-#endif
-#ifndef        _NOKANJIFCONV
+# endif        /* _USEDOSEMU */
+# ifndef       _NOKANJIFCONV
X       if (fputok) {
X               c = getkcode(cp);
X               if (codep) *codep = c;
X               cp = kanjiconv2(kbuf, cp, MAXPATHLEN - 1, DEFCODE, c, L_FNAME);
X       }
-#endif
-#if    defined (FD) && !defined (_NOROCKRIDGE)
+# endif
+# ifndef       _NOROCKRIDGE
X       if (!norockridge && (cp = detranspath(cp, rbuf)) == rbuf) {
X               if (rrreal) strcpy(rrreal, rbuf);
X               if (rdlink && rrreadlink(cp, buf, MAXPATHLEN - 1) >= 0) {
@@ -2129,19 +2157,16 @@
X                       cp = detranspath(rpath, rbuf);
X               }
X       }
-#endif
+# endif
X       if (cp == path) return(path);
X       if (needfile && (file = strrdelim(cp, 0))) file++;
X       else file = cp;
-#if    defined (FD) && defined (_USEDOSEMU)
-       if (n && !_dospath(file)) {
-               buf[0] = n;
-               buf[1] = ':';
-               strcpy(&(buf[2]), file);
-       }
+# ifdef        _USEDOSEMU
+       if (n && !_dospath(file)) strcpy(gendospath(buf, n, '\0'), file);
X       else
-#endif
+# endif
X       strcpy(buf, file);
X 
X       return(buf);
X }
+#endif /* FD */
diff -urNP ../FD-2.08d/kanji.hin ./kanji.hin
--- ../FD-2.08d/kanji.hin       Tue Jun 13 00:00:00 2006
+++ ./kanji.hin Fri Jul 28 00:00:00 2006
@@ -383,6 +383,21 @@
X #define       NCVP_E \
X       meslist("漢字コード変換したくないディレクトリを指定します.", \
X               "Define the directories with no kanji conversion.")
+#define        PAGR_E \
+       meslist("ファイルの閲覧に用いるプログラムを指定します.", \
+               "Define the program to view files.")
+#define        EDIT_E \
+       meslist("ファイルの編集に用いるプログラムを指定します.", \
+               "Define the program to edit files.")
+#define        SHEL_E \
+       meslist("コマンドの実行に用いるシェルプログラムを指定します.", \
+               "Define the shell program to execute commands.")
+#define        FCED_E \
+       meslist("組込みコマンド fc でファイルの編集に用いるプログラムを指定します.", \
+               "Define the program to edit files in fc the builtin command.")
+#define        CMSP_E \
+       meslist("バッチファイルの実行に用いるプログラムを指定します.", \
+               "Define the program to execute batch files.")
X 
X #define       TENV_K  mesconv("内部変数", "Variables")
X #define       TBIND_K mesconv("キー割当て", "Key bind")
@@ -423,6 +438,41 @@
X #define       VBIOS_K mesconv(" (BIOS 経由)", " (via BIOS)")
X #define       VCOL2_K mesconv("背景色を黒に", "black background")
X #define       VCOL3_K mesconv("表示色を黒に", "black foreground")
+#define        VBLK1_K mesconv("黒", "BLK")
+#define        VRED1_K mesconv("赤", "RED")
+#define        VGRN1_K mesconv("緑", "GRN")
+#define        VYEL1_K mesconv("黄", "YEL")
+#define        VBLU1_K mesconv("青", "BLU")
+#define        VMAG1_K mesconv("紫", "MAG")
+#define        VCYN1_K mesconv("水", "CYN")
+#define        VWHI1_K mesconv("白", "WHI")
+#define        VFOR1_K mesconv("文字", "fore")
+#define        VBAK1_K mesconv("背景", "back")
+#define        VCREG_K mesconv("通常", "regular")
+#define        VCBAK_K mesconv("背景", "back")
+#define        VCDIR_K mesconv("DIR", "dir")
+#define        VCUWR_K mesconv("書禁", "unwritable")
+#define        VCURD_K mesconv("隠し", "hidden")
+#define        VCLNK_K mesconv("リンク", "link")
+#if    MSDOS
+#define        VCSCK_K mesconv("システム", "system")
+#define        VCFIF_K mesconv("VOL", "label")
+#else
+#define        VCSCK_K mesconv("ソケット", "socket")
+#define        VCFIF_K mesconv("FIFO", "FIFO")
+#endif
+#define        VCBLD_K mesconv("ブロック", "block")
+#define        VCCHD_K mesconv("キャラ", "char")
+#define        VBLK2_K mesconv("黒", "black")
+#define        VRED2_K mesconv("赤", "red")
+#define        VGRN2_K mesconv("緑", "green")
+#define        VYEL2_K mesconv("黄色", "yellow")
+#define        VBLU2_K mesconv("青", "blue")
+#define        VMAG2_K mesconv("紫", "magenta")
+#define        VCYN2_K mesconv("水色", "cyan")
+#define        VWHI2_K mesconv("白", "white")
+#define        VFOR2_K mesconv("文字既定色", "default(fore)")
+#define        VBAK2_K mesconv("背景既定色", "default(back)")
X #define       VNONE_K mesconv("なし", "none")
X #define       VNCNV_K mesconv("変換しない", "NoConvert")
X #define       VENG_K  mesconv("英語", "English")
@@ -430,6 +480,10 @@
X #define       VOJIS_K mesconv("旧JIS", "OldJIS")
X #define       VUTF8_K mesconv("汎用", "normal")
X #define       VUTFM_K mesconv("Mac用", "forMac")
+#define        VKYCD_K mesconv("内部変数 %s に設定するキーを押して下さい:", \
+                       "Push the key which you set to the variable %s:")
+#define        VKYOK_K mesconv("[%s]を内部変数 %s に設定してよろしいですか ?", \
+                       "Do you set [%s] to the variable %s ?")
X #define       VUSET_K mesconv("(定義削除)", "(unset)")
X #define       VDEF_K  mesconv(" (既定値)", " (default)")
X #define       VUDEF_K mesconv("(未定義)", "(undefined)")
diff -urNP ../FD-2.08d/kanjicnv.c ./kanjicnv.c
--- ../FD-2.08d/kanjicnv.c      Tue Jun 13 00:00:00 2006
+++ ./kanjicnv.c        Fri Jul 28 00:00:00 2006
@@ -4,9 +4,9 @@
X  *    tiny Kanji code converter
X  */
X 
+#include "machine.h"
X #include <stdio.h>
X #include <string.h>
-#include "machine.h"
X 
X #ifndef       NOUNISTDH
X #include <unistd.h>
@@ -24,9 +24,10 @@
X #define       SJIS    010
X #define       EUC     020
X 
-static VOID fputc2 __P_((int, FILE *));
-static VOID convert __P_((int, int, FILE *));
-static VOID output __P_((FILE *, int, int));
+static VOID NEAR fputc2 __P_((int, FILE *));
+static VOID NEAR convert __P_((int, int, FILE *));
+static VOID NEAR output __P_((FILE *, int, int));
+int main __P_((int, char *[]));
X 
X static int msboff = 0;
X static int prefix = 0;
@@ -34,7 +35,7 @@
X static int kanjicode = SJIS;
X 
X 
-static VOID fputc2(c, fp)
+static VOID NEAR fputc2(c, fp)
X int c;
X FILE *fp;
X {
@@ -42,7 +43,7 @@
X       else fputc(c, fp);
X }
X 
-static VOID convert(j1, j2, fp)
+static VOID NEAR convert(j1, j2, fp)
X int j1, j2;
X FILE *fp;
X {
@@ -73,11 +74,11 @@
X       }
X }
X 
-static VOID output(fp, c, mode)
+static VOID NEAR output(fp, c, mode)
X FILE *fp;
X int c, mode;
X {
-       static unsigned char buf[2];
+       static u_char buf[2];
X       static int kanji1 = 0;
X       static int bufp = 0;
X 
diff -urNP ../FD-2.08d/kctype.h ./kctype.h
--- ../FD-2.08d/kctype.h        Tue Jun 13 00:00:00 2006
+++ ./kctype.h  Fri Jul 28 00:00:00 2006
@@ -341,6 +341,23 @@
X }
X #endif        /* K_INTERN */
X 
+K_EXTERN int iskana1 __P_((char *, int *));
+#ifdef K_INTERN
+int iskana1(s, ip)
+char *s;
+int *ip;
+{
+# ifdef        CODEEUC
+       int n;
+
+       if ((n = isekana(s, *ip))) (*ip)++;
+       return(n);
+# else
+       return(isskana(s, *ip));
+# endif
+}
+#endif /* K_INTERN */
+
X #ifdef        _NOKANJICONV
X # ifdef       CODEEUC
X # define      isinkanji1(c,k) iseuc(c)
diff -urNP ../FD-2.08d/libc.c ./libc.c
--- ../FD-2.08d/libc.c  Tue Jun 13 00:00:00 2006
+++ ./libc.c    Fri Jul 28 00:00:00 2006
@@ -202,6 +202,9 @@
X #if   MSDOS || !defined (_NODOSDRIVE)
X       int drv;
X #endif
+#if    MSDOS
+       int drive;
+#endif
X       char tmp[MAXPATHLEN];
X 
X       strcpy(tmp, path);
@@ -209,19 +212,14 @@
X 
X #if   MSDOS
X       drv = dospath(nullstr, NULL);
-       if ((resolved[0] = _dospath(path))) path += 2;
+       if ((drive = _dospath(path))) path += 2;
X       if (*path == _SC_) {
-               if (!resolved[0]) resolved[0] = drv;
-               resolved[1] = ':';
-               resolved[2] = _SC_;
-               resolved[3] = '\0';
-       }
-       else if (resolved[0] && resolved[0] != drv) {
-               if (setcurdrv(resolved[0], 0) < 0) {
-                       resolved[1] = ':';
-                       resolved[2] = _SC_;
-                       resolved[3] = '\0';
-               }
+               if (!drive) drive = drv;
+               VOID_C gendospath(resolved, drive, _SC_);
+       }
+       else if (drive && drive != drv) {
+               if (setcurdrv(drive, 0) < 0)
+                       VOID_C gendospath(resolved, drive, _SC_);
X               else {
X                       if (!Xgetwd(resolved)) lostcwd(resolved);
X                       if (setcurdrv(drv, 0) < 0) error("setcurdrv()");
@@ -239,12 +237,7 @@
X                       cp = dosgetcwd(resolved, MAXPATHLEN - 1);
X                       lastdrive = duplastdrive;
X               }
-               if (!cp) {
-                       resolved[0] = drv;
-                       resolved[1] = ':';
-                       resolved[2] = _SC_;
-                       resolved[3] = '\0';
-               }
+               if (!cp) VOID_C gendospath(resolved, drv, _SC_);
X       }
X # endif
X #endif        /* !MSDOS */
@@ -643,11 +636,17 @@
X       return(len);
X }
X 
+#ifdef CODEEUC
X int strlen2(s)
X char *s;
X {
-       return(snprintf2(NULL, 0, "%s", s));
+       int i, len;
+
+       for (i = len = 0; s[i]; i++, len++) if (isekana(s, i)) i++;
+
+       return(len);
X }
+#endif /* CODEEUC */
X 
X int strlen3(s)
X char *s;
@@ -819,6 +818,7 @@
X #ifdef        _NOORIGSHELL
X       if (export) environ = _putenv2(cp, environ);
X       else environ2 = _putenv2(cp, environ2);
+       evalenv(name, len);
X # ifndef      _NOPTY
X       sendparent(TE_PUTSHELLVAR, name, value, export);
X # endif
diff -urNP ../FD-2.08d/machine.h ./machine.h
--- ../FD-2.08d/machine.h       Tue Jun 13 00:00:00 2006
+++ ./machine.h Fri Jul 28 00:00:00 2006
@@ -1043,7 +1043,7 @@
X #define       ALLOC_T         size_t
X #define       VOID_A          void
X #else
-#define        ALLOC_T         unsigned
+#define        ALLOC_T         u_int
X #define       VOID_A
X #endif
X 
diff -urNP ../FD-2.08d/main.c ./main.c
--- ../FD-2.08d/main.c  Tue Jun 13 00:00:00 2006
+++ ./main.c    Fri Jul 28 00:00:00 2006
@@ -14,7 +14,7 @@
X # ifndef      DJGPP
X # include <dos.h>
X #  ifdef      __TURBOC__
-extern unsigned _stklen = 0x5800;
+extern u_int _stklen = 0x5800;
X #  define     harderr_t       void
X #  else
X #  define     harderr_t       int
@@ -32,6 +32,10 @@
X #define       isorgpid()      (mypid == orgpid)
X #endif
X 
+#ifndef        DATADIR
+#define        DATADIR         progpath
+#endif
+
X #if   MSDOS
X # ifndef      BSPATHDELIM
X extern char *adjustpname __P_((char *));
@@ -67,7 +71,7 @@
X extern int custno;
X #endif
X extern char *deftmpdir;
-#if    !defined (_NOKANJICONV) || !defined (_NODOSDRIVE)
+#ifdef _USEUNICODE
X extern char *unitblpath;
X #endif
X #ifndef       _NOPTY
@@ -160,6 +164,7 @@
X static char *NEAR searchenv __P_((char *, char *[]));
X static VOID NEAR setexecname __P_((char *));
X static VOID NEAR setexecpath __P_((char *, char *[]));
+int main __P_((int, char *[], char *[]));
X 
X char *origpath = NULL;
X char *progpath = NULL;
@@ -1066,7 +1071,6 @@
X               setenv2(tmp, cp, 0);
X               free(tmp);
X       }
-       evalenv();
X 
X       return(i);
X }
@@ -1181,7 +1185,7 @@
X       }
X       free(origpath);
X       free(progname);
-#if    !defined (_NOKANJICONV) || !defined (_NODOSDRIVE)
+#ifdef _USEUNICODE
X       free(unitblpath);
X #endif
X #ifndef       _NODOSDRIVE
@@ -1235,7 +1239,7 @@
X # ifndef      _NOROCKRIDGE
X       detranspath(NULL, NULL);
X # endif
-# if   !defined (_NOKANJICONV) || !defined (_NODOSDRIVE)
+# ifdef        _USEUNICODE
X       discardunitable();
X # endif
X #endif        /* DEBUG */
@@ -1357,13 +1361,10 @@
X       environ[i] = NULL;
X #endif
X 
+       initenv();
X       setexecpath(argv[0], envp);
-#if    !defined (_NOKANJICONV) || !defined (_NODOSDRIVE)
-# ifdef        DATADIR
+#ifdef _USEUNICODE
X       unitblpath = strdup2(DATADIR);
-# else
-       unitblpath = strdup2(progpath);
-# endif
X #endif
X 
X #ifdef        _NOORIGSHELL
diff -urNP ../FD-2.08d/makefile.b98 ./makefile.b98
--- ../FD-2.08d/makefile.b98    Tue Jun 13 00:00:00 2006
+++ ./makefile.b98      Fri Jul 28 00:00:00 2006
@@ -4,14 +4,14 @@
X 
X TITLE = FD-
X VERMAJ        = 2
-VERSION        = 2.08d
+VERSION        = 2.08e
X PREFIX        = 
X CONFDIR       = 
X BUILD =
X MANSEC        = 1
X TOPDIR        = $(BUILD)$(PREFIX)
X BINDIR        = $(TOPDIR)\bin
-DATADIR        = $(TOPDIR)\share
+DATADIR        = $(TOPDIR)\share\fd
X MANDIR        = $(TOPDIR)\man\man$(MANSEC)
X CATDIR        = $(TOPDIR)\man\cat$(MANSEC)
X JMANDIR       = $(TOPDIR)\man\man$(MANSEC)
@@ -233,6 +233,7 @@
X               $(CHMOD) a+r-x $(BLDRC); \
X       fi
X       -if [ -f $(UNITBL) ]; then \
+               [ -d $(BINDIR) ] || mkdir $(BINDIR); \
X               $(INSTALL) $(UNITBL) $(BINDIR); \
X               $(CHMOD) a+r-x $(BINDIR)\$(UNITBL); \
X       fi
@@ -298,7 +299,7 @@
X       makedepend \
X               -s "# DO NOT DELETE THIS LINE -- make depend depends on it." \
X               -f Makefile.tmp -- $(CFLAGS) -- $(SRC)
-       rm -f Makefile.tmp.bak
+       -$(RM) Makefile.tmp.bak
X       $(SED) -e '\^# DO NOT DELETE THIS LINE\,$$d' Makefile.in.bak \
X               > Makefile.in
X       $(ECHO) "# DO NOT DELETE THIS LINE -- make depend depends on it." \
@@ -308,7 +309,8 @@
X               -e 's\\.o\\_\_OBJ\_\_\g' \
X               -e 's\ *$$\\' \
X               -e '\: *$$\d' Makefile.tmp >> Makefile.in
-       rm -f Makefile.in.bak Makefile.tmp
+       -$(RM) Makefile.in.bak
+       -$(RM) Makefile.tmp
X 
X 
X ############################################################
@@ -408,11 +410,11 @@
X       gzip -f $(TITLE)sh-$$VER.tar)
X 
X lzh: $(SOURCES)
-       rm -f $(TITLE)$(VERSION).lzh
+       -$(RM) $(TITLE)$(VERSION).lzh
X       lha a $(TITLE)$(VERSION).lzh $(SOURCES)
X 
X shar: $(SOURCES)
-       rm -f $(TITLE)$(VERSION).shar.[0-9][0-9]
+       -$(RM) $(TITLE)$(VERSION).shar.[0-9][0-9]
X       shar -L50 -apc -n $(TITLE)$(VERSION) -o $(TITLE)$(VERSION).shar \
X       -T $(SRCS) -C $(JSRCS)
X 
@@ -505,17 +507,26 @@
X       tar cf ..\ipk.tar .\debian-binary .\data.tar.gz .\control.tar.gz)
X       gzip .\ipk.tar
X       mv .\ipk.tar.gz .\fd_$(VERSION)-1_arm.ipk
-       -rm -rf $(IPKWDIR) $(IPKTDIR)
+       -$(RM) -r $(IPKWDIR) $(IPKTDIR)
X 
X clean:
-       -rm -f core *.obj
-       -rm -f funcno.h kanji.h
-       -rm -f kanjicnv$(EXE) expfunc$(EXE)
-       -rm -f mkfuncno$(EXE) mkunitbl$(EXE)
-       -rm -f fdsh$(EXE) fdbsh$(EXE)
-       -rm -f $(PROGRAM)$(EXE) $(PROGRAM).$(MANSEC) $(PROGRAM).$(MANSEC)c
-       -rm -f $(PROGRAM).eng $(PROGRAM).doc
-       -rm -f $(ARGS) $(UNITBL)
+       -$(RM) core
+       -$(RM) *.obj
+       -$(RM) funcno.h
+       -$(RM) kanji.h
+       -$(RM) kanjicnv$(EXE)
+       -$(RM) expfunc$(EXE)
+       -$(RM) mkfuncno$(EXE)
+       -$(RM) mkunitbl$(EXE)
+       -$(RM) fdsh$(EXE)
+       -$(RM) fdbsh$(EXE)
+       -$(RM) $(PROGRAM)$(EXE)
+       -$(RM) $(PROGRAM).$(MANSEC)
+       -$(RM) $(PROGRAM).$(MANSEC)c
+       -$(RM) $(PROGRAM).eng
+       -$(RM) $(PROGRAM).doc
+       -$(RM) $(ARGS)
+       -$(RM) $(UNITBL)
X # DO NOT DELETE THIS LINE -- make depend depends on it.
X 
X main.obj: fd.h
@@ -529,24 +540,31 @@
X printf.obj: printf.h
X printf.obj: kctype.h
X termio.obj: machine.h config.h
-termio.obj: printf.h termio.h
+termio.obj: printf.h
+termio.obj: termio.h
X term.obj: machine.h config.h
-term.obj: printf.h
-term.obj: kctype.h
+term.obj: printf.h kctype.h
X term.obj: termio.h
X term.obj: term.h
X pathname.obj: machine.h config.h
-pathname.obj: printf.h kctype.h
+pathname.obj: printf.h
+pathname.obj: kctype.h
X pathname.obj: pathname.h
-system.obj: machine.h config.h printf.h kctype.h
+system.obj: machine.h config.h
+system.obj: printf.h
+system.obj: kctype.h
X system.obj: pathname.h
X system.obj: system.h termio.h
X system.obj: wait.h
-posixsh.obj: machine.h config.h printf.h kctype.h
+posixsh.obj: machine.h config.h
+posixsh.obj: printf.h
+posixsh.obj: kctype.h
X posixsh.obj: pathname.h
X posixsh.obj: system.h termio.h
X posixsh.obj: wait.h
-doscom.obj: machine.h config.h printf.h kctype.h
+doscom.obj: machine.h config.h
+doscom.obj: printf.h
+doscom.obj: kctype.h
X doscom.obj: pathname.h
X doscom.obj: system.h termio.h
X doscom.obj: wait.h
@@ -661,9 +679,9 @@
X shell.obj: dosdisk.h kanji.h system.h termio.h
X shell.obj: wait.h
X shell.obj: termemu.h
-kanji.obj: machine.h config.h
-kanji.obj: kctype.h pathname.h
-kanji.obj: term.h
+kanji.obj: machine.h
+kanji.obj: config.h
+kanji.obj: printf.h kctype.h
X input.obj: fd.h
X input.obj: machine.h config.h
X input.obj: types.h
diff -urNP ../FD-2.08d/makefile.bpc ./makefile.bpc
--- ../FD-2.08d/makefile.bpc    Tue Jun 13 00:00:00 2006
+++ ./makefile.bpc      Fri Jul 28 00:00:00 2006
@@ -4,14 +4,14 @@
X 
X TITLE = FD-
X VERMAJ        = 2
-VERSION        = 2.08d
+VERSION        = 2.08e
X PREFIX        = 
X CONFDIR       = 
X BUILD =
X MANSEC        = 1
X TOPDIR        = $(BUILD)$(PREFIX)
X BINDIR        = $(TOPDIR)\bin
-DATADIR        = $(TOPDIR)\share
+DATADIR        = $(TOPDIR)\share\fd
X MANDIR        = $(TOPDIR)\man\man$(MANSEC)
X CATDIR        = $(TOPDIR)\man\cat$(MANSEC)
X JMANDIR       = $(TOPDIR)\man\man$(MANSEC)
@@ -233,6 +233,7 @@
X               $(CHMOD) a+r-x $(BLDRC); \
X       fi
X       -if [ -f $(UNITBL) ]; then \
+               [ -d $(BINDIR) ] || mkdir $(BINDIR); \
X               $(INSTALL) $(UNITBL) $(BINDIR); \
X               $(CHMOD) a+r-x $(BINDIR)\$(UNITBL); \
X       fi
@@ -298,7 +299,7 @@
X       makedepend \
X               -s "# DO NOT DELETE THIS LINE -- make depend depends on it." \
X               -f Makefile.tmp -- $(CFLAGS) -- $(SRC)
-       rm -f Makefile.tmp.bak
+       -$(RM) Makefile.tmp.bak
X       $(SED) -e '\^# DO NOT DELETE THIS LINE\,$$d' Makefile.in.bak \
X               > Makefile.in
X       $(ECHO) "# DO NOT DELETE THIS LINE -- make depend depends on it." \
@@ -308,7 +309,8 @@
X               -e 's\\.o\\_\_OBJ\_\_\g' \
X               -e 's\ *$$\\' \
X               -e '\: *$$\d' Makefile.tmp >> Makefile.in
-       rm -f Makefile.in.bak Makefile.tmp
+       -$(RM) Makefile.in.bak
+       -$(RM) Makefile.tmp
X 
X 
X ############################################################
@@ -408,11 +410,11 @@
X       gzip -f $(TITLE)sh-$$VER.tar)
X 
X lzh: $(SOURCES)
-       rm -f $(TITLE)$(VERSION).lzh
+       -$(RM) $(TITLE)$(VERSION).lzh
X       lha a $(TITLE)$(VERSION).lzh $(SOURCES)
X 
X shar: $(SOURCES)
-       rm -f $(TITLE)$(VERSION).shar.[0-9][0-9]
+       -$(RM) $(TITLE)$(VERSION).shar.[0-9][0-9]
X       shar -L50 -apc -n $(TITLE)$(VERSION) -o $(TITLE)$(VERSION).shar \
X       -T $(SRCS) -C $(JSRCS)
X 
@@ -505,17 +507,26 @@
X       tar cf ..\ipk.tar .\debian-binary .\data.tar.gz .\control.tar.gz)
X       gzip .\ipk.tar
X       mv .\ipk.tar.gz .\fd_$(VERSION)-1_arm.ipk
-       -rm -rf $(IPKWDIR) $(IPKTDIR)
+       -$(RM) -r $(IPKWDIR) $(IPKTDIR)
X 
X clean:
-       -rm -f core *.obj
-       -rm -f funcno.h kanji.h
-       -rm -f kanjicnv$(EXE) expfunc$(EXE)
-       -rm -f mkfuncno$(EXE) mkunitbl$(EXE)
-       -rm -f fdsh$(EXE) fdbsh$(EXE)
-       -rm -f $(PROGRAM)$(EXE) $(PROGRAM).$(MANSEC) $(PROGRAM).$(MANSEC)c
-       -rm -f $(PROGRAM).eng $(PROGRAM).doc
-       -rm -f $(ARGS) $(UNITBL)
+       -$(RM) core
+       -$(RM) *.obj
+       -$(RM) funcno.h
+       -$(RM) kanji.h
+       -$(RM) kanjicnv$(EXE)
+       -$(RM) expfunc$(EXE)
+       -$(RM) mkfuncno$(EXE)
+       -$(RM) mkunitbl$(EXE)
+       -$(RM) fdsh$(EXE)
+       -$(RM) fdbsh$(EXE)
+       -$(RM) $(PROGRAM)$(EXE)
+       -$(RM) $(PROGRAM).$(MANSEC)
+       -$(RM) $(PROGRAM).$(MANSEC)c
+       -$(RM) $(PROGRAM).eng
+       -$(RM) $(PROGRAM).doc
+       -$(RM) $(ARGS)
+       -$(RM) $(UNITBL)
X # DO NOT DELETE THIS LINE -- make depend depends on it.
X 
X main.obj: fd.h
@@ -529,24 +540,31 @@
X printf.obj: printf.h
X printf.obj: kctype.h
X termio.obj: machine.h config.h
-termio.obj: printf.h termio.h
+termio.obj: printf.h
+termio.obj: termio.h
X term.obj: machine.h config.h
-term.obj: printf.h
-term.obj: kctype.h
+term.obj: printf.h kctype.h
X term.obj: termio.h
X term.obj: term.h
X pathname.obj: machine.h config.h
-pathname.obj: printf.h kctype.h
+pathname.obj: printf.h
+pathname.obj: kctype.h
X pathname.obj: pathname.h
-system.obj: machine.h config.h printf.h kctype.h
+system.obj: machine.h config.h
+system.obj: printf.h
+system.obj: kctype.h
X system.obj: pathname.h
X system.obj: system.h termio.h
X system.obj: wait.h
-posixsh.obj: machine.h config.h printf.h kctype.h
+posixsh.obj: machine.h config.h
+posixsh.obj: printf.h
+posixsh.obj: kctype.h
X posixsh.obj: pathname.h
X posixsh.obj: system.h termio.h
X posixsh.obj: wait.h
-doscom.obj: machine.h config.h printf.h kctype.h
+doscom.obj: machine.h config.h
+doscom.obj: printf.h
+doscom.obj: kctype.h
X doscom.obj: pathname.h
X doscom.obj: system.h termio.h
X doscom.obj: wait.h
@@ -661,9 +679,9 @@
X shell.obj: dosdisk.h kanji.h system.h termio.h
X shell.obj: wait.h
X shell.obj: termemu.h
-kanji.obj: machine.h config.h
-kanji.obj: kctype.h pathname.h
-kanji.obj: term.h
+kanji.obj: machine.h
+kanji.obj: config.h
+kanji.obj: printf.h kctype.h
X input.obj: fd.h
X input.obj: machine.h config.h
X input.obj: types.h
diff -urNP ../FD-2.08d/makefile.d98 ./makefile.d98
--- ../FD-2.08d/makefile.d98    Tue Jun 13 00:00:00 2006
+++ ./makefile.d98      Fri Jul 28 00:00:00 2006
@@ -4,14 +4,14 @@
X 
X TITLE = FD-
X VERMAJ        = 2
-VERSION        = 2.08d
+VERSION        = 2.08e
X PREFIX        = 
X CONFDIR       = 
X BUILD =
X MANSEC        = 1
X TOPDIR        = $(BUILD)$(PREFIX)
X BINDIR        = $(TOPDIR)\bin
-DATADIR        = $(TOPDIR)\share
+DATADIR        = $(TOPDIR)\share\fd
X MANDIR        = $(TOPDIR)\man\man$(MANSEC)
X CATDIR        = $(TOPDIR)\man\cat$(MANSEC)
X JMANDIR       = $(TOPDIR)\man\man$(MANSEC)
@@ -233,6 +233,7 @@
X               $(CHMOD) a+r-x $(BLDRC); \
X       fi
X       -if [ -f $(UNITBL) ]; then \
+               [ -d $(BINDIR) ] || mkdir $(BINDIR); \
X               $(INSTALL) $(UNITBL) $(BINDIR); \
X               $(CHMOD) a+r-x $(BINDIR)\$(UNITBL); \
X       fi
@@ -298,7 +299,7 @@
X       makedepend \
X               -s "# DO NOT DELETE THIS LINE -- make depend depends on it." \
X               -f Makefile.tmp -- $(CFLAGS) -- $(SRC)
-       rm -f Makefile.tmp.bak
+       -$(RM) Makefile.tmp.bak
X       $(SED) -e '\^# DO NOT DELETE THIS LINE\,$$d' Makefile.in.bak \
X               > Makefile.in
X       $(ECHO) "# DO NOT DELETE THIS LINE -- make depend depends on it." \
@@ -308,7 +309,8 @@
X               -e 's\\.o\\_\_OBJ\_\_\g' \
X               -e 's\ *$$\\' \
X               -e '\: *$$\d' Makefile.tmp >> Makefile.in
-       rm -f Makefile.in.bak Makefile.tmp
+       -$(RM) Makefile.in.bak
+       -$(RM) Makefile.tmp
X 
X 
X ############################################################
@@ -408,11 +410,11 @@
X       gzip -f $(TITLE)sh-$$VER.tar)
X 
X lzh: $(SOURCES)
-       rm -f $(TITLE)$(VERSION).lzh
+       -$(RM) $(TITLE)$(VERSION).lzh
X       lha a $(TITLE)$(VERSION).lzh $(SOURCES)
X 
X shar: $(SOURCES)
-       rm -f $(TITLE)$(VERSION).shar.[0-9][0-9]
+       -$(RM) $(TITLE)$(VERSION).shar.[0-9][0-9]
X       shar -L50 -apc -n $(TITLE)$(VERSION) -o $(TITLE)$(VERSION).shar \
X       -T $(SRCS) -C $(JSRCS)
X 
@@ -505,17 +507,26 @@
X       tar cf ..\ipk.tar .\debian-binary .\data.tar.gz .\control.tar.gz)
X       gzip .\ipk.tar
X       mv .\ipk.tar.gz .\fd_$(VERSION)-1_arm.ipk
-       -rm -rf $(IPKWDIR) $(IPKTDIR)
+       -$(RM) -r $(IPKWDIR) $(IPKTDIR)
X 
X clean:
-       -rm -f core *.o
-       -rm -f funcno.h kanji.h
-       -rm -f kanjicnv$(EXE) expfunc$(EXE)
-       -rm -f mkfuncno$(EXE) mkunitbl$(EXE)
-       -rm -f fdsh$(EXE) fdbsh$(EXE)
-       -rm -f $(PROGRAM)$(EXE) $(PROGRAM).$(MANSEC) $(PROGRAM).$(MANSEC)c
-       -rm -f $(PROGRAM).eng $(PROGRAM).doc
-       -rm -f $(ARGS) $(UNITBL)
+       -$(RM) core
+       -$(RM) *.o
+       -$(RM) funcno.h
+       -$(RM) kanji.h
+       -$(RM) kanjicnv$(EXE)
+       -$(RM) expfunc$(EXE)
+       -$(RM) mkfuncno$(EXE)
+       -$(RM) mkunitbl$(EXE)
+       -$(RM) fdsh$(EXE)
+       -$(RM) fdbsh$(EXE)
+       -$(RM) $(PROGRAM)$(EXE)
+       -$(RM) $(PROGRAM).$(MANSEC)
+       -$(RM) $(PROGRAM).$(MANSEC)c
+       -$(RM) $(PROGRAM).eng
+       -$(RM) $(PROGRAM).doc
+       -$(RM) $(ARGS)
+       -$(RM) $(UNITBL)
X # DO NOT DELETE THIS LINE -- make depend depends on it.
X 
X main.o: fd.h
@@ -529,24 +540,31 @@
X printf.o: printf.h
X printf.o: kctype.h
X termio.o: machine.h config.h
-termio.o: printf.h termio.h
+termio.o: printf.h
+termio.o: termio.h
X term.o: machine.h config.h
-term.o: printf.h
-term.o: kctype.h
+term.o: printf.h kctype.h
X term.o: termio.h
X term.o: term.h
X pathname.o: machine.h config.h
-pathname.o: printf.h kctype.h
+pathname.o: printf.h
+pathname.o: kctype.h
X pathname.o: pathname.h
-system.o: machine.h config.h printf.h kctype.h
+system.o: machine.h config.h
+system.o: printf.h
+system.o: kctype.h
X system.o: pathname.h
X system.o: system.h termio.h
X system.o: wait.h
-posixsh.o: machine.h config.h printf.h kctype.h
+posixsh.o: machine.h config.h
+posixsh.o: printf.h
+posixsh.o: kctype.h
X posixsh.o: pathname.h
X posixsh.o: system.h termio.h
X posixsh.o: wait.h
-doscom.o: machine.h config.h printf.h kctype.h
+doscom.o: machine.h config.h
+doscom.o: printf.h
+doscom.o: kctype.h
X doscom.o: pathname.h
X doscom.o: system.h termio.h
X doscom.o: wait.h
@@ -661,9 +679,9 @@
X shell.o: dosdisk.h kanji.h system.h termio.h
X shell.o: wait.h
X shell.o: termemu.h
-kanji.o: machine.h config.h
-kanji.o: kctype.h pathname.h
-kanji.o: term.h
+kanji.o: machine.h
+kanji.o: config.h
+kanji.o: printf.h kctype.h
X input.o: fd.h
X input.o: machine.h config.h
X input.o: types.h
diff -urNP ../FD-2.08d/makefile.dpc ./makefile.dpc
--- ../FD-2.08d/makefile.dpc    Tue Jun 13 00:00:00 2006
+++ ./makefile.dpc      Fri Jul 28 00:00:00 2006
@@ -4,14 +4,14 @@
X 
X TITLE = FD-
X VERMAJ        = 2
-VERSION        = 2.08d
+VERSION        = 2.08e
X PREFIX        = 
X CONFDIR       = 
X BUILD =
X MANSEC        = 1
X TOPDIR        = $(BUILD)$(PREFIX)
X BINDIR        = $(TOPDIR)\bin
-DATADIR        = $(TOPDIR)\share
+DATADIR        = $(TOPDIR)\share\fd
X MANDIR        = $(TOPDIR)\man\man$(MANSEC)
X CATDIR        = $(TOPDIR)\man\cat$(MANSEC)
X JMANDIR       = $(TOPDIR)\man\man$(MANSEC)
@@ -233,6 +233,7 @@
X               $(CHMOD) a+r-x $(BLDRC); \
X       fi
X       -if [ -f $(UNITBL) ]; then \
+               [ -d $(BINDIR) ] || mkdir $(BINDIR); \
X               $(INSTALL) $(UNITBL) $(BINDIR); \
X               $(CHMOD) a+r-x $(BINDIR)\$(UNITBL); \
X       fi
@@ -298,7 +299,7 @@
X       makedepend \
X               -s "# DO NOT DELETE THIS LINE -- make depend depends on it." \
X               -f Makefile.tmp -- $(CFLAGS) -- $(SRC)
-       rm -f Makefile.tmp.bak
+       -$(RM) Makefile.tmp.bak
X       $(SED) -e '\^# DO NOT DELETE THIS LINE\,$$d' Makefile.in.bak \
X               > Makefile.in
X       $(ECHO) "# DO NOT DELETE THIS LINE -- make depend depends on it." \
@@ -308,7 +309,8 @@
X               -e 's\\.o\\_\_OBJ\_\_\g' \
X               -e 's\ *$$\\' \
X               -e '\: *$$\d' Makefile.tmp >> Makefile.in
-       rm -f Makefile.in.bak Makefile.tmp
+       -$(RM) Makefile.in.bak
+       -$(RM) Makefile.tmp
X 
X 
X ############################################################
@@ -408,11 +410,11 @@
X       gzip -f $(TITLE)sh-$$VER.tar)
X 
X lzh: $(SOURCES)
-       rm -f $(TITLE)$(VERSION).lzh
+       -$(RM) $(TITLE)$(VERSION).lzh
X       lha a $(TITLE)$(VERSION).lzh $(SOURCES)
X 
X shar: $(SOURCES)
-       rm -f $(TITLE)$(VERSION).shar.[0-9][0-9]
+       -$(RM) $(TITLE)$(VERSION).shar.[0-9][0-9]
X       shar -L50 -apc -n $(TITLE)$(VERSION) -o $(TITLE)$(VERSION).shar \
X       -T $(SRCS) -C $(JSRCS)
X 
@@ -505,17 +507,26 @@
X       tar cf ..\ipk.tar .\debian-binary .\data.tar.gz .\control.tar.gz)
X       gzip .\ipk.tar
X       mv .\ipk.tar.gz .\fd_$(VERSION)-1_arm.ipk
-       -rm -rf $(IPKWDIR) $(IPKTDIR)
+       -$(RM) -r $(IPKWDIR) $(IPKTDIR)
X 
X clean:
-       -rm -f core *.o
-       -rm -f funcno.h kanji.h
-       -rm -f kanjicnv$(EXE) expfunc$(EXE)
-       -rm -f mkfuncno$(EXE) mkunitbl$(EXE)
-       -rm -f fdsh$(EXE) fdbsh$(EXE)
-       -rm -f $(PROGRAM)$(EXE) $(PROGRAM).$(MANSEC) $(PROGRAM).$(MANSEC)c
-       -rm -f $(PROGRAM).eng $(PROGRAM).doc
-       -rm -f $(ARGS) $(UNITBL)
+       -$(RM) core
+       -$(RM) *.o
+       -$(RM) funcno.h
+       -$(RM) kanji.h
+       -$(RM) kanjicnv$(EXE)
+       -$(RM) expfunc$(EXE)
+       -$(RM) mkfuncno$(EXE)
+       -$(RM) mkunitbl$(EXE)
+       -$(RM) fdsh$(EXE)
+       -$(RM) fdbsh$(EXE)
+       -$(RM) $(PROGRAM)$(EXE)
+       -$(RM) $(PROGRAM).$(MANSEC)
+       -$(RM) $(PROGRAM).$(MANSEC)c
+       -$(RM) $(PROGRAM).eng
+       -$(RM) $(PROGRAM).doc
+       -$(RM) $(ARGS)
+       -$(RM) $(UNITBL)
X # DO NOT DELETE THIS LINE -- make depend depends on it.
X 
X main.o: fd.h
@@ -529,24 +540,31 @@
X printf.o: printf.h
X printf.o: kctype.h
X termio.o: machine.h config.h
-termio.o: printf.h termio.h
+termio.o: printf.h
+termio.o: termio.h
X term.o: machine.h config.h
-term.o: printf.h
-term.o: kctype.h
+term.o: printf.h kctype.h
X term.o: termio.h
X term.o: term.h
X pathname.o: machine.h config.h
-pathname.o: printf.h kctype.h
+pathname.o: printf.h
+pathname.o: kctype.h
X pathname.o: pathname.h
-system.o: machine.h config.h printf.h kctype.h
+system.o: machine.h config.h
+system.o: printf.h
+system.o: kctype.h
X system.o: pathname.h
X system.o: system.h termio.h
X system.o: wait.h
-posixsh.o: machine.h config.h printf.h kctype.h
+posixsh.o: machine.h config.h
+posixsh.o: printf.h
+posixsh.o: kctype.h
X posixsh.o: pathname.h
X posixsh.o: system.h termio.h
X posixsh.o: wait.h
-doscom.o: machine.h config.h printf.h kctype.h
+doscom.o: machine.h config.h
+doscom.o: printf.h
+doscom.o: kctype.h
X doscom.o: pathname.h
X doscom.o: system.h termio.h
X doscom.o: wait.h
@@ -661,9 +679,9 @@
X shell.o: dosdisk.h kanji.h system.h termio.h
X shell.o: wait.h
X shell.o: termemu.h
-kanji.o: machine.h config.h
-kanji.o: kctype.h pathname.h
-kanji.o: term.h
+kanji.o: machine.h
+kanji.o: config.h
+kanji.o: printf.h kctype.h
X input.o: fd.h
X input.o: machine.h config.h
X input.o: types.h
diff -urNP ../FD-2.08d/makefile.g98 ./makefile.g98
--- ../FD-2.08d/makefile.g98    Tue Jun 13 00:00:00 2006
+++ ./makefile.g98      Fri Jul 28 00:00:00 2006
@@ -4,14 +4,14 @@
X 
X TITLE = FD-
X VERMAJ        = 2
-VERSION        = 2.08d
+VERSION        = 2.08e
X PREFIX        = 
X CONFDIR       = 
X BUILD =
X MANSEC        = 1
X TOPDIR        = $(BUILD)$(PREFIX)
X BINDIR        = $(TOPDIR)\bin
-DATADIR        = $(TOPDIR)\share
+DATADIR        = $(TOPDIR)\share\fd
X MANDIR        = $(TOPDIR)\man\man$(MANSEC)
X CATDIR        = $(TOPDIR)\man\cat$(MANSEC)
X JMANDIR       = $(TOPDIR)\man\man$(MANSEC)
@@ -233,6 +233,7 @@
X               $(CHMOD) a+r-x $(BLDRC); \
X       fi
X       -if [ -f $(UNITBL) ]; then \
+               [ -d $(BINDIR) ] || mkdir $(BINDIR); \
X               $(INSTALL) $(UNITBL) $(BINDIR); \
X               $(CHMOD) a+r-x $(BINDIR)\$(UNITBL); \
X       fi
@@ -298,7 +299,7 @@
X       makedepend \
X               -s "# DO NOT DELETE THIS LINE -- make depend depends on it." \
X               -f Makefile.tmp -- $(CFLAGS) -- $(SRC)
-       rm -f Makefile.tmp.bak
+       -$(RM) Makefile.tmp.bak
X       $(SED) -e '\^# DO NOT DELETE THIS LINE\,$$d' Makefile.in.bak \
X               > Makefile.in
X       $(ECHO) "# DO NOT DELETE THIS LINE -- make depend depends on it." \
@@ -308,7 +309,8 @@
X               -e 's\\.o\\_\_OBJ\_\_\g' \
X               -e 's\ *$$\\' \
X               -e '\: *$$\d' Makefile.tmp >> Makefile.in
-       rm -f Makefile.in.bak Makefile.tmp
+       -$(RM) Makefile.in.bak
+       -$(RM) Makefile.tmp
X 
X 
X ############################################################
@@ -408,11 +410,11 @@
X       gzip -f $(TITLE)sh-$$VER.tar)
X 
X lzh: $(SOURCES)
-       rm -f $(TITLE)$(VERSION).lzh
+       -$(RM) $(TITLE)$(VERSION).lzh
X       lha a $(TITLE)$(VERSION).lzh $(SOURCES)
X 
X shar: $(SOURCES)
-       rm -f $(TITLE)$(VERSION).shar.[0-9][0-9]
+       -$(RM) $(TITLE)$(VERSION).shar.[0-9][0-9]
X       shar -L50 -apc -n $(TITLE)$(VERSION) -o $(TITLE)$(VERSION).shar \
X       -T $(SRCS) -C $(JSRCS)
X 
@@ -505,17 +507,26 @@
X       tar cf ..\ipk.tar .\debian-binary .\data.tar.gz .\control.tar.gz)
X       gzip .\ipk.tar
X       mv .\ipk.tar.gz .\fd_$(VERSION)-1_arm.ipk
-       -rm -rf $(IPKWDIR) $(IPKTDIR)
+       -$(RM) -r $(IPKWDIR) $(IPKTDIR)
X 
X clean:
-       -rm -f core *.o
-       -rm -f funcno.h kanji.h
-       -rm -f kanjicnv$(EXE) expfunc$(EXE)
-       -rm -f mkfuncno$(EXE) mkunitbl$(EXE)
-       -rm -f fdsh$(EXE) fdbsh$(EXE)
-       -rm -f $(PROGRAM)$(EXE) $(PROGRAM).$(MANSEC) $(PROGRAM).$(MANSEC)c
-       -rm -f $(PROGRAM).eng $(PROGRAM).doc
-       -rm -f $(ARGS) $(UNITBL)
+       -$(RM) core
+       -$(RM) *.o
+       -$(RM) funcno.h
+       -$(RM) kanji.h
+       -$(RM) kanjicnv$(EXE)
+       -$(RM) expfunc$(EXE)
+       -$(RM) mkfuncno$(EXE)
+       -$(RM) mkunitbl$(EXE)
+       -$(RM) fdsh$(EXE)
+       -$(RM) fdbsh$(EXE)
+       -$(RM) $(PROGRAM)$(EXE)
+       -$(RM) $(PROGRAM).$(MANSEC)
+       -$(RM) $(PROGRAM).$(MANSEC)c
+       -$(RM) $(PROGRAM).eng
+       -$(RM) $(PROGRAM).doc
+       -$(RM) $(ARGS)
+       -$(RM) $(UNITBL)
X # DO NOT DELETE THIS LINE -- make depend depends on it.
X 
X main.o: fd.h
@@ -529,24 +540,31 @@
X printf.o: printf.h
X printf.o: kctype.h
X termio.o: machine.h config.h
-termio.o: printf.h termio.h
+termio.o: printf.h
+termio.o: termio.h
X term.o: machine.h config.h
-term.o: printf.h
-term.o: kctype.h
+term.o: printf.h kctype.h
X term.o: termio.h
X term.o: term.h
X pathname.o: machine.h config.h
-pathname.o: printf.h kctype.h
+pathname.o: printf.h
+pathname.o: kctype.h
X pathname.o: pathname.h
-system.o: machine.h config.h printf.h kctype.h
+system.o: machine.h config.h
+system.o: printf.h
+system.o: kctype.h
X system.o: pathname.h
X system.o: system.h termio.h
X system.o: wait.h
-posixsh.o: machine.h config.h printf.h kctype.h
+posixsh.o: machine.h config.h
+posixsh.o: printf.h
+posixsh.o: kctype.h
X posixsh.o: pathname.h
X posixsh.o: system.h termio.h
X posixsh.o: wait.h
-doscom.o: machine.h config.h printf.h kctype.h
+doscom.o: machine.h config.h
+doscom.o: printf.h
+doscom.o: kctype.h
X doscom.o: pathname.h
X doscom.o: system.h termio.h
X doscom.o: wait.h
@@ -661,9 +679,9 @@
X shell.o: dosdisk.h kanji.h system.h termio.h
X shell.o: wait.h
X shell.o: termemu.h
-kanji.o: machine.h config.h
-kanji.o: kctype.h pathname.h
-kanji.o: term.h
+kanji.o: machine.h
+kanji.o: config.h
+kanji.o: printf.h kctype.h
X input.o: fd.h
X input.o: machine.h config.h
X input.o: types.h
diff -urNP ../FD-2.08d/makefile.gpc ./makefile.gpc
--- ../FD-2.08d/makefile.gpc    Tue Jun 13 00:00:00 2006
+++ ./makefile.gpc      Fri Jul 28 00:00:00 2006
@@ -4,14 +4,14 @@
X 
X TITLE = FD-
X VERMAJ        = 2
-VERSION        = 2.08d
+VERSION        = 2.08e
X PREFIX        = 
X CONFDIR       = 
X BUILD =
X MANSEC        = 1
X TOPDIR        = $(BUILD)$(PREFIX)
X BINDIR        = $(TOPDIR)\bin
-DATADIR        = $(TOPDIR)\share
+DATADIR        = $(TOPDIR)\share\fd
X MANDIR        = $(TOPDIR)\man\man$(MANSEC)
X CATDIR        = $(TOPDIR)\man\cat$(MANSEC)
X JMANDIR       = $(TOPDIR)\man\man$(MANSEC)
@@ -233,6 +233,7 @@
X               $(CHMOD) a+r-x $(BLDRC); \
X       fi
X       -if [ -f $(UNITBL) ]; then \
+               [ -d $(BINDIR) ] || mkdir $(BINDIR); \
X               $(INSTALL) $(UNITBL) $(BINDIR); \
X               $(CHMOD) a+r-x $(BINDIR)\$(UNITBL); \
X       fi
@@ -298,7 +299,7 @@
X       makedepend \
X               -s "# DO NOT DELETE THIS LINE -- make depend depends on it." \
X               -f Makefile.tmp -- $(CFLAGS) -- $(SRC)
-       rm -f Makefile.tmp.bak
+       -$(RM) Makefile.tmp.bak
X       $(SED) -e '\^# DO NOT DELETE THIS LINE\,$$d' Makefile.in.bak \
X               > Makefile.in
X       $(ECHO) "# DO NOT DELETE THIS LINE -- make depend depends on it." \
@@ -308,7 +309,8 @@
X               -e 's\\.o\\_\_OBJ\_\_\g' \
X               -e 's\ *$$\\' \
X               -e '\: *$$\d' Makefile.tmp >> Makefile.in
-       rm -f Makefile.in.bak Makefile.tmp
+       -$(RM) Makefile.in.bak
+       -$(RM) Makefile.tmp
X 
X 
X ############################################################
@@ -408,11 +410,11 @@
X       gzip -f $(TITLE)sh-$$VER.tar)
X 
X lzh: $(SOURCES)
-       rm -f $(TITLE)$(VERSION).lzh
+       -$(RM) $(TITLE)$(VERSION).lzh
X       lha a $(TITLE)$(VERSION).lzh $(SOURCES)
X 
X shar: $(SOURCES)
-       rm -f $(TITLE)$(VERSION).shar.[0-9][0-9]
+       -$(RM) $(TITLE)$(VERSION).shar.[0-9][0-9]
X       shar -L50 -apc -n $(TITLE)$(VERSION) -o $(TITLE)$(VERSION).shar \
X       -T $(SRCS) -C $(JSRCS)
X 
@@ -505,17 +507,26 @@
X       tar cf ..\ipk.tar .\debian-binary .\data.tar.gz .\control.tar.gz)
X       gzip .\ipk.tar
X       mv .\ipk.tar.gz .\fd_$(VERSION)-1_arm.ipk
-       -rm -rf $(IPKWDIR) $(IPKTDIR)
+       -$(RM) -r $(IPKWDIR) $(IPKTDIR)
X 
X clean:
-       -rm -f core *.o
-       -rm -f funcno.h kanji.h
-       -rm -f kanjicnv$(EXE) expfunc$(EXE)
-       -rm -f mkfuncno$(EXE) mkunitbl$(EXE)
-       -rm -f fdsh$(EXE) fdbsh$(EXE)
-       -rm -f $(PROGRAM)$(EXE) $(PROGRAM).$(MANSEC) $(PROGRAM).$(MANSEC)c
-       -rm -f $(PROGRAM).eng $(PROGRAM).doc
-       -rm -f $(ARGS) $(UNITBL)
+       -$(RM) core
+       -$(RM) *.o
+       -$(RM) funcno.h
+       -$(RM) kanji.h
+       -$(RM) kanjicnv$(EXE)
+       -$(RM) expfunc$(EXE)
+       -$(RM) mkfuncno$(EXE)
+       -$(RM) mkunitbl$(EXE)
+       -$(RM) fdsh$(EXE)
+       -$(RM) fdbsh$(EXE)
+       -$(RM) $(PROGRAM)$(EXE)
+       -$(RM) $(PROGRAM).$(MANSEC)
+       -$(RM) $(PROGRAM).$(MANSEC)c
+       -$(RM) $(PROGRAM).eng
+       -$(RM) $(PROGRAM).doc
+       -$(RM) $(ARGS)
+       -$(RM) $(UNITBL)
X # DO NOT DELETE THIS LINE -- make depend depends on it.
X 
X main.o: fd.h
@@ -529,24 +540,31 @@
X printf.o: printf.h
X printf.o: kctype.h
X termio.o: machine.h config.h
-termio.o: printf.h termio.h
+termio.o: printf.h
+termio.o: termio.h
X term.o: machine.h config.h
-term.o: printf.h
-term.o: kctype.h
+term.o: printf.h kctype.h
X term.o: termio.h
X term.o: term.h
X pathname.o: machine.h config.h
-pathname.o: printf.h kctype.h
+pathname.o: printf.h
+pathname.o: kctype.h
X pathname.o: pathname.h
-system.o: machine.h config.h printf.h kctype.h
+system.o: machine.h config.h
+system.o: printf.h
+system.o: kctype.h
X system.o: pathname.h
X system.o: system.h termio.h
X system.o: wait.h
-posixsh.o: machine.h config.h printf.h kctype.h
+posixsh.o: machine.h config.h
+posixsh.o: printf.h
+posixsh.o: kctype.h
X posixsh.o: pathname.h
X posixsh.o: system.h termio.h
X posixsh.o: wait.h
-doscom.o: machine.h config.h printf.h kctype.h
+doscom.o: machine.h config.h
+doscom.o: printf.h
+doscom.o: kctype.h
X doscom.o: pathname.h
X doscom.o: system.h termio.h
X doscom.o: wait.h
@@ -661,9 +679,9 @@
X shell.o: dosdisk.h kanji.h system.h termio.h
X shell.o: wait.h
X shell.o: termemu.h
-kanji.o: machine.h config.h
-kanji.o: kctype.h pathname.h
-kanji.o: term.h
+kanji.o: machine.h
+kanji.o: config.h
+kanji.o: printf.h kctype.h
X input.o: fd.h
X input.o: machine.h config.h
X input.o: types.h
diff -urNP ../FD-2.08d/makefile.l98 ./makefile.l98
--- ../FD-2.08d/makefile.l98    Tue Jun 13 00:00:00 2006
+++ ./makefile.l98      Fri Jul 28 00:00:00 2006
@@ -4,14 +4,14 @@
SHAR_EOF
  : || $echo 'restore of' 'FD-2.08e.patch' 'failed'
fi
$echo 'End of' 'FD-2.08e.patch' 'part' '4'
$echo 'File' 'FD-2.08e.patch' 'is continued in part' '5'
echo 5 > _sh01537/seq
exit 0
-- 
                                               しらい たかし