しらいです。

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

Submitted-by: shirai@chandra2
Archive-name: FD-2.08d.patch/part02

---- Cut Here and feed the following to sh ----
#!/bin/sh
# This is `FD-2.08d.shar.02' (part 2 of FD-2.08d.patch).
# Do not concatenate these parts, unpack them in order with `/bin/sh'.
# File `FD-2.08d.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 _sh02637/seq; then
  $echo 'Please unpack part 1 first!'
  exit 1
fi
shar_sequence=`cat _sh02637/seq`
if test "$shar_sequence" != 2; then
  $echo 'Please unpack part' "$shar_sequence" 'next!'
  exit 1
fi
if test ! -f _sh02637/new; then
  $echo 'x -' 'STILL SKIPPING' 'FD-2.08d.patch'
else
  $echo 'x -' 'continuing file' 'FD-2.08d.patch'
  sed 's/^X//' << 'SHAR_EOF' >> FD-2.08d.patch &&
@@ -1190,7 +1197,7 @@
X # endif
X # ifndef      _NOCUSTOMIZE
X       if (orighelpindex) {
-               freestrarray(orighelpindex, 10);
+               freestrarray(orighelpindex, MAXHELPINDEX);
X               free(orighelpindex);
X       }
X       free(origbindlist);
@@ -1332,7 +1339,8 @@
X       }
X #endif        /* !_NOARCHIVE */
X 
-       for (i = 0; i < 10; i++) helpindex[i] = strdup2(helpindex[i]);
+       for (i = 0; i < MAXHELPINDEX; i++)
+               helpindex[i] = strdup2(helpindex[i]);
X #ifdef        _USEDOSEMU
X       for (i = 0; fdtype[i].name; i++) {
X               fdtype[i].name = strdup2(fdtype[i].name);
@@ -1372,7 +1380,10 @@
X # endif
X               Xexit2(i);
X       }
-       fdmode = interactive = 1;
+#ifndef        _NOORIGSHELL
+       interactive =
+#endif
+       fdmode = 1;
X       setshellvar(envp);
X       prepareterm();
X       argc = initoption(argc, argv, envp);
diff -urNP ../FD-2.08c/makefile.b98 ./makefile.b98
--- ../FD-2.08c/makefile.b98    Wed May 24 00:00:00 2006
+++ ./makefile.b98      Tue Jun 13 00:00:00 2006
@@ -4,7 +4,7 @@
X 
X TITLE = FD-
X VERMAJ        = 2
-VERSION        = 2.08c
+VERSION        = 2.08d
X PREFIX        = 
X CONFDIR       = 
X BUILD =
diff -urNP ../FD-2.08c/makefile.bpc ./makefile.bpc
--- ../FD-2.08c/makefile.bpc    Wed May 24 00:00:00 2006
+++ ./makefile.bpc      Tue Jun 13 00:00:00 2006
@@ -4,7 +4,7 @@
X 
X TITLE = FD-
X VERMAJ        = 2
-VERSION        = 2.08c
+VERSION        = 2.08d
X PREFIX        = 
X CONFDIR       = 
X BUILD =
diff -urNP ../FD-2.08c/makefile.d98 ./makefile.d98
--- ../FD-2.08c/makefile.d98    Wed May 24 00:00:00 2006
+++ ./makefile.d98      Tue Jun 13 00:00:00 2006
@@ -4,7 +4,7 @@
X 
X TITLE = FD-
X VERMAJ        = 2
-VERSION        = 2.08c
+VERSION        = 2.08d
X PREFIX        = 
X CONFDIR       = 
X BUILD =
diff -urNP ../FD-2.08c/makefile.dpc ./makefile.dpc
--- ../FD-2.08c/makefile.dpc    Wed May 24 00:00:00 2006
+++ ./makefile.dpc      Tue Jun 13 00:00:00 2006
@@ -4,7 +4,7 @@
X 
X TITLE = FD-
X VERMAJ        = 2
-VERSION        = 2.08c
+VERSION        = 2.08d
X PREFIX        = 
X CONFDIR       = 
X BUILD =
diff -urNP ../FD-2.08c/makefile.g98 ./makefile.g98
--- ../FD-2.08c/makefile.g98    Wed May 24 00:00:00 2006
+++ ./makefile.g98      Tue Jun 13 00:00:00 2006
@@ -4,7 +4,7 @@
X 
X TITLE = FD-
X VERMAJ        = 2
-VERSION        = 2.08c
+VERSION        = 2.08d
X PREFIX        = 
X CONFDIR       = 
X BUILD =
diff -urNP ../FD-2.08c/makefile.gpc ./makefile.gpc
--- ../FD-2.08c/makefile.gpc    Wed May 24 00:00:00 2006
+++ ./makefile.gpc      Tue Jun 13 00:00:00 2006
@@ -4,7 +4,7 @@
X 
X TITLE = FD-
X VERMAJ        = 2
-VERSION        = 2.08c
+VERSION        = 2.08d
X PREFIX        = 
X CONFDIR       = 
X BUILD =
diff -urNP ../FD-2.08c/makefile.l98 ./makefile.l98
--- ../FD-2.08c/makefile.l98    Wed May 24 00:00:00 2006
+++ ./makefile.l98      Tue Jun 13 00:00:00 2006
@@ -4,7 +4,7 @@
X 
X TITLE = FD-
X VERMAJ        = 2
-VERSION        = 2.08c
+VERSION        = 2.08d
X PREFIX        = 
X CONFDIR       = 
X BUILD =
diff -urNP ../FD-2.08c/makefile.lpc ./makefile.lpc
--- ../FD-2.08c/makefile.lpc    Wed May 24 00:00:00 2006
+++ ./makefile.lpc      Tue Jun 13 00:00:00 2006
@@ -4,7 +4,7 @@
X 
X TITLE = FD-
X VERMAJ        = 2
-VERSION        = 2.08c
+VERSION        = 2.08d
X PREFIX        = 
X CONFDIR       = 
X BUILD =
diff -urNP ../FD-2.08c/shell.c ./shell.c
--- ../FD-2.08c/shell.c Wed May 24 00:00:00 2006
+++ ./shell.c   Tue Jun 13 00:00:00 2006
@@ -1621,17 +1621,21 @@
X       return(tmp);
X }
X 
-int loadhistory(n, file)
+int loadhistory(n)
X int n;
-char *file;
X {
+#ifndef        NOFLOCK
+       int nfs;
+#endif
X       FILE *fp;
X       char *line;
X       int i, j, size;
X 
-       if (!file || !(fp = Xfopen(file, "r"))) return(-1);
+       if (!histfile || !histfile[0]) return(0);
+       if (!(fp = Xfopen(histfile, "r"))) return(-1);
X #ifndef       NOFLOCK
-       VOID_C lockfile(Xfileno(fp), LCK_READ);
+       if ((nfs = isnfs(histfile)) <= 0)
+               VOID_C lockfile(Xfileno(fp), LCK_READ);
X #endif
X 
X       size = (int)histsize[n];
@@ -1648,7 +1652,7 @@
X               history[n][0] = line;
X       }
X #ifndef       NOFLOCK
-       VOID_C lockfile(Xfileno(fp), LCK_UNLOCK);
+       if (nfs <= 0) VOID_C lockfile(Xfileno(fp), LCK_UNLOCK);
X #endif
X       Xfclose(fp);
X 
@@ -1674,23 +1678,27 @@
X       VOID_C Xfputc('\n', fp);
X }
X 
-int savehistory(n, file)
+int savehistory(n)
X int n;
-char *file;
X {
+#ifndef        NOFLOCK
+       int nfs;
+#endif
X       FILE *fp;
X       int i, size;
X 
+       if (!histfile || !histfile[0] || savehist <= 0) return(0);
X       if (!history[n] || !history[n][0]) return(-1);
-       if (!file || !(fp = Xfopen(file, "w"))) return(-1);
+       if (!(fp = Xfopen(histfile, "w"))) return(-1);
X #ifndef       NOFLOCK
-       VOID_C lockfile(Xfileno(fp), LCK_WRITE);
+       if ((nfs = isnfs(histfile)) <= 0)
+               VOID_C lockfile(Xfileno(fp), LCK_WRITE);
X #endif
X 
X       size = (savehist > (int)histsize[n]) ? (int)histsize[n] : savehist;
X       for (i = size - 1; i >= 0; i--) convhistory(history[n][i], fp);
X #ifndef       NOFLOCK
-       VOID_C lockfile(Xfileno(fp), LCK_UNLOCK);
+       if (nfs <= 0) VOID_C lockfile(Xfileno(fp), LCK_UNLOCK);
X #endif
X       Xfclose(fp);
X 
@@ -1761,7 +1769,7 @@
X               cp = c_realloc(cp, j + 1, &size);
X               pc = parsechar(&(command[i]), -1, '!', 0, &quote, NULL);
X               if (pc == PC_WORD || pc == PC_ESCAPE) cp[j++] = command[i++];
-               else if (pc == '!'){
+               else if (pc == '!') {
X                       len = i++;
X                       if ((n = parsehist(command, &i, quote)) < 0) {
X                               if (i < 0) {
diff -urNP ../FD-2.08c/system.c ./system.c
--- ../FD-2.08c/system.c        Wed May 24 00:00:00 2006
+++ ./system.c  Tue Jun 13 00:00:00 2006
@@ -137,9 +137,6 @@
X extern char fullpath[];
X extern char *origpath;
X extern int inruncom;
-# ifdef        SIGALRM
-extern int noalrm;
-# endif
X extern int fd_restricted;
X extern int fdmode;
X extern int physical_path;
diff -urNP ../FD-2.08c/term.c ./term.c
--- ../FD-2.08c/term.c  Wed May 24 00:00:00 2006
+++ ./term.c    Tue Jun 13 00:00:00 2006
@@ -363,7 +363,7 @@
X static char *NEAR tgetkeyseq __P_((int, char *));
X static kstree_t *NEAR newkeyseqtree __P_((kstree_t *, int));
X static int NEAR freekeyseqtree __P_((kstree_t *, int));
-static int NEAR cmpkeyseq __P_((CONST VOID_P, CONST VOID_P));
+static int cmpkeyseq __P_((CONST VOID_P, CONST VOID_P));
X static int NEAR sortkeyseq __P_((VOID_A));
X static int putch3 __P_((tputs_t));
X #endif        /* !MSDOS */
@@ -1699,7 +1699,7 @@
X       return(0);
X }
X 
-static int NEAR cmpkeyseq(vp1, vp2)
+static int cmpkeyseq(vp1, vp2)
X CONST VOID_P vp1;
X CONST VOID_P vp2;
X {
@@ -2972,8 +2972,12 @@
X # if  !defined (_NOKANJICONV) || defined (CODEEUC)
X       else if (key != C_EKANA) /*EMPTY*/;
X #  if !defined (_NOKANJICONV)
+#   ifdef      CODEEUC
+       else if (inputkcode != EUC && inputkcode != NOCNV) /*EMPTY*/;
+#   else
X       else if (inputkcode != EUC) /*EMPTY*/;
-#  endif
+#   endif
+#  endif       /* !_NOKANJICONV */
X       else {
X               if (!kbhit2(WAITMETA * 1000L) || (ch = getch2()) == EOF)
X                       return(key);
@@ -3035,13 +3039,13 @@
X {
X       int ch;
X 
-       ch = getkey2(sig);
+       if ((ch = getkey2(sig)) < 0) return(ch);
X       if (ch >= K_F('*') && ch < K_DL) {
X               if (ch == K_F('?')) ch = K_CR;
X               else ch -= K_F0;
X       }
X 
-       return(ch & 0777);
+       return(ch & 01777);
X }
X 
X int ungetch2(c)
diff -urNP ../FD-2.08c/termemu.c ./termemu.c
--- ../FD-2.08c/termemu.c       Wed May 24 00:00:00 2006
+++ ./termemu.c Tue Jun 13 00:00:00 2006
@@ -83,7 +83,7 @@
X       }
X 
X       y1 = y2 = -1;
-       switch(n) {
+       switch (n) {
X               case C_DOWN:
X               case C_SCROLLFORW:
X               case C_NEWLINE:
diff -urNP ../FD-2.08c/version.h ./version.h
--- ../FD-2.08c/version.h       Wed May 24 00:00:00 2006
+++ ./version.h Tue Jun 13 00:00:00 2006
@@ -5,4 +5,4 @@
X  */
X 
X char *distributor = NULL;
-static char version[] = "@(#)fd.c  2.08c 05/24/06";
+static char version[] = "@(#)fd.c  2.08d 06/13/06";
diff -urNP ../FD-2.08c/wait.h ./wait.h
--- ../FD-2.08c/wait.h  Wed May 24 00:00:00 2006
+++ ./wait.h    Tue Jun 13 00:00:00 2006
@@ -132,3 +132,12 @@
X #if   !defined (SIGWINCH) && defined (SIGWINDOW)
X #define       SIGWINCH        SIGWINDOW
X #endif
+
+#ifdef FD
+# ifdef        SIGALRM
+extern int noalrm;
+# define       sigalrm(sig)    ((!noalrm && (sig)) ? SIGALRM : 0)
+# else
+# define       sigalrm(sig)    0
+# endif
+#endif /* FD */
SHAR_EOF
  $echo 'File' 'FD-2.08d.patch' 'is complete' &&
  $shar_touch -am 06070103106 'FD-2.08d.patch' &&
  chmod 0644 'FD-2.08d.patch' ||
  $echo 'restore of' 'FD-2.08d.patch' 'failed'
  if ( md5sum --help 2>&1 | grep 'sage: md5sum \[' ) >/dev/null 2>&1 \
  && ( md5sum --version 2>&1 | grep -v 'textutils 1.12' ) >/dev/null; then
    md5sum -c << SHAR_EOF >/dev/null 2>&1 \
    || $echo 'FD-2.08d.patch:' 'MD5 check failed'
87872a0e85d58d91c7ee1bba9c42bd83  FD-2.08d.patch
SHAR_EOF
  else
    shar_count="`LC_ALL= LC_CTYPE= LANG= wc -c < 'FD-2.08d.patch'`"
    test 55440 -eq "$shar_count" ||
    $echo 'FD-2.08d.patch:' 'original size' '55440,' 'current size' "$shar_count!"
  fi
fi
$echo 'You have unpacked the last part'
rm -fr _sh02637
exit 0
-- 
                                               しらい たかし