diff options
author | Akinori MUSHA <knu@FreeBSD.org> | 2002-09-15 20:55:58 +0000 |
---|---|---|
committer | Akinori MUSHA <knu@FreeBSD.org> | 2002-09-15 20:55:58 +0000 |
commit | 6a228fad08ceddf4b25b5a8d268aa1d30ab9b69d (patch) | |
tree | 5cd14157572ac1fa3db7a8bf5fa277c8257dfef6 /shells/fd | |
parent | Upgrade to 0.5. (diff) |
- Apply a couple of patches posted on the FD-clone mailing list,
which fix bugs in file name completion and handling of tar archives
that contain ".".
- Update fd2rc:
o Properly call zip(1) with -r (recursive).
o Make some file extensions case insensitive.
o Source /etc/fd2rc.local so administrators can put their own local
configurations in it.
o Set FD_WRITEFS to 1 (do not ask).
o Set FD_INHERITCOPY to 1 (preserve timestamps).
Diffstat (limited to 'shells/fd')
-rw-r--r-- | shells/fd/Makefile | 2 | ||||
-rw-r--r-- | shells/fd/files/patch-_fdrc | 66 | ||||
-rw-r--r-- | shells/fd/files/patch-archive.c | 14 | ||||
-rw-r--r-- | shells/fd/files/patch-input.c | 252 |
4 files changed, 310 insertions, 24 deletions
diff --git a/shells/fd/Makefile b/shells/fd/Makefile index 1c922c6cf06b..12bd55a6239b 100644 --- a/shells/fd/Makefile +++ b/shells/fd/Makefile @@ -7,7 +7,7 @@ PORTNAME= fd PORTVERSION= 2.01b -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= shells MASTER_SITES= http://hp.vector.co.jp/authors/VA012337/soft/fd/ \ ftp://ftp.vector.co.jp/pack/unix/util/file/filer/fd/ diff --git a/shells/fd/files/patch-_fdrc b/shells/fd/files/patch-_fdrc index 8ac4168b01e0..646ac89b8679 100644 --- a/shells/fd/files/patch-_fdrc +++ b/shells/fd/files/patch-_fdrc @@ -1,5 +1,5 @@ ---- _fdrc.orig Mon Jun 10 00:00:00 2002 -+++ _fdrc Sun Aug 11 22:18:20 2002 +--- _fdrc.orig Wed Jul 10 00:00:00 2002 ++++ _fdrc Mon Sep 16 05:39:03 2002 @@ -13,2 +13,3 @@ #SORTTYPE=0 +FD_SORTTYPE=101 @@ -8,38 +8,50 @@ #SORTTREE=0 +FD_SORTTREE=1 -@@ -50,2 +52,3 @@ +@@ -35,2 +37,3 @@ + #WRITEFS=0 ++FD_WRITEFS=1 + +@@ -45,2 +48,3 @@ + #INHERITCOPY=0 ++FD_INHERITCOPY=1 + +@@ -50,2 +54,3 @@ #ADJTTY=0 +FD_ADJTTY=1 -@@ -62,2 +65,3 @@ +@@ -62,2 +67,3 @@ #DEFCOLUMNS=2 +FD_DEFCOLUMNS=1 -@@ -104,2 +108,3 @@ +@@ -104,2 +110,3 @@ #ANSICOLOR=0 +FD_ANSICOLOR=1 -@@ -144,2 +149,3 @@ +@@ -144,2 +151,3 @@ #LANGUAGE=$LANG +FD_LANGUAGE=$LANG -@@ -215,2 +221,3 @@ +@@ -215,2 +223,3 @@ #PAGER=more%K +FD_PAGER=${PAGER:-/usr/bin/more}%K #EDITOR=vi -@@ -222,2 +229,34 @@ +@@ -222,2 +231,38 @@ # launcher definition +tar="tar" +tar_format="%a %u/%g %s %m %d %t %y %f" + -+launch ".tar" "$tar tvf" "$tar_format" ++launch "/.tar" "$tar tvf" "$tar_format" ++ ++for ext in .tar.Z .taZ .TAZ; do ++ launch "$ext" "$tar Ztvf %C" "$tar_format" ++done + -+for ext in .tar.Z .taZ .tar.gz .tgz .taz; do ++for ext in .tar.gz /.tgz .taz; do + launch "$ext" "$tar ztvf %C" "$tar_format" +done + -+for ext in .tar.bz2 .tbz2 .tbz; do ++for ext in .tar.bz2 .tbz2 /.tbz; do + launch "$ext" "$tar jtvf %C" "$tar_format" +done + @@ -49,45 +61,47 @@ + launch "$ext" "unzip -lqq" "%s %m-%d-%y %t %f" +done + -+for ext in .Z .gz; do ++for ext in .Z /.gz; do + launch "$ext" "zcat %C | $PAGER" +done + -+launch ".bz2" "bzip2 -cd %C | $PAGER" ++launch "/.bz2" "bzip2 -cd %C | $PAGER" + +# RCS/CVS files +launch ",v" "rlog %C | $PAGER" + +# distribution files -+launch ".aa" "cat %X.?? | $tar tvfz -" "$tar_format" -+arch ".aa" "echo ERROR" "cat %X.?? | $tar zxf - %TA" ++launch "/.aa" "cat %X.?? | $tar tvfz -" "$tar_format" ++arch "/.aa" "echo ERROR" "cat %X.?? | $tar zxf - %TA" + #(Default) -@@ -325,2 +364,37 @@ +@@ -325,2 +370,39 @@ # archiver definition + -+arch ".tar" "$tar cf %C %T" "$tar xf %C %TA" ++for ext in /.tar; do ++ arch "$ext" "$tar cf %C %T" "$tar xf %C %TA" ++done + -+for ext in .tar.Z .taZ; do ++for ext in .tar.Z .taZ .TAZ; do + arch "$ext" "$tar Zcf %C %T" "$tar Zxf %C %TA" +done + -+for ext in .tar.gz .tgz .taz; do ++for ext in .tar.gz /.tgz .taz; do + arch "$ext" "$tar cf - %T | gzip -9c > %C" "$tar zxf %C %TA" +done + -+for ext in .tar.bz2 .tbz2 .tbz; do ++for ext in .tar.bz2 .tbz2 /.tbz; do + arch "$ext" "$tar cf - %T | bzip2 -9c > %C" "$tar jxf %C %TA" +done + +arch ".Z" "compress %M" "uncompress %C" -+arch ".gz" "gzip -9 %M" "gzip -d %C" -+arch ".bz2" "bzip2 -9 %M" "bzip2 -d %C" ++arch "/.gz" "gzip -9 %M" "gzip -d %C" ++arch "/.bz2" "bzip2 -9 %M" "bzip2 -d %C" + +arch "/.lzh" "lha aq %C %TA" "lha xq %C %TA" + +for ext in /.zip /.jar; do -+ arch "$ext" "zip -q %C %TA" "unzip -q %C %TA" ++ arch "$ext" "zip -qr %C %TA" "unzip -q %C %TA" +done + +_uuencode() { @@ -101,3 +115,9 @@ +arch ".uu" "_uuencode %C %TA" "uudecode -ic < %C" + #(Default) +@@ -387 +469,5 @@ + #keymap DEL "\033[3~" ++ ++if [ -f /etc/fd2rc.local ]; then ++ source /etc/fd2rc.local ++fi diff --git a/shells/fd/files/patch-archive.c b/shells/fd/files/patch-archive.c new file mode 100644 index 000000000000..ffca5e8a8192 --- /dev/null +++ b/shells/fd/files/patch-archive.c @@ -0,0 +1,14 @@ +A patch taken from: [FDclone-users:00027] + +diff -ur ../old/FD-2.01b/archive.c ./archive.c +--- ../old/FD-2.01b/archive.c Wed Jul 10 00:00:00 2002 ++++ ./archive.c Mon Aug 19 08:11:18 2002 +@@ -1188,7 +1188,7 @@ + if (*path == _SC_) len = 1; + else if ((cp = strdelim(path, 0))) len = cp - path; + else len = strlen(path); +- if (strncmp(path, "..", len)) { ++ if (len != 2 || strncmp(path, "..", len)) { + if (!searcharcdir(path, len)) { + strcpy(archivedir, duparcdir); + return(NULL); diff --git a/shells/fd/files/patch-input.c b/shells/fd/files/patch-input.c new file mode 100644 index 000000000000..9a74338c9cc3 --- /dev/null +++ b/shells/fd/files/patch-input.c @@ -0,0 +1,252 @@ +A patch taken from: [FDclone-users:00020] + +diff -u ../old/FD-2.01b/input.c ./input.c +--- ../old/FD-2.01b/input.c Wed Jul 10 00:00:00 2002 ++++ ./input.c Mon Jul 29 14:54:00 2002 +@@ -1052,7 +1052,7 @@ + int cx, len, plen, max, linemax, comline, cont; + { + # if !MSDOS || !defined (_NOORIGSHELL) +- int bq; ++ int bq, hadmeta; + # endif + char *cp1, *cp2, **argv; + int i, l, ins, top, fix, argc, quote, quoted, hasmeta; +@@ -1064,7 +1064,7 @@ + } + + # if !MSDOS || !defined (_NOORIGSHELL) +- bq = 0; ++ bq = hadmeta = 0; + # endif + quote = '\0'; + quoted = 0; +@@ -1077,6 +1077,13 @@ + quote = '\0'; + } + else if (iskanji1(s, i)) i++; ++# if !MSDOS || !defined (_NOORIGSHELL) ++ else if (quote == '\''); ++ else if (isnmeta(s, i, quote, cx)) { ++ i++; ++ hadmeta++; ++ } ++# endif + else if (quote); + else if (s[i] == '"') quote = s[i]; + # if !MSDOS || !defined (_NOORIGSHELL) +@@ -1182,8 +1189,23 @@ + } + + if (hasmeta) { ++ char *tmp, *home; ++ int hlen; ++ ++ if (quote || quoted > top || s[top] != '~') { ++ home = NULL; ++ i = hlen = 0; ++ } ++ else { ++ tmp = &(s[top]); ++ s[len] = '\0'; ++ home = malloc2(len - top + 1); ++ hlen = evalhome(&home, 0, &tmp); ++ i = ++tmp - &(s[top]); ++ } ++ + if (quote); +- else if (quoted) { ++ else if (quoted > top) { + quote = s[quoted]; + setcursor(vlen(s, quoted), plen, max, linemax); + deletechar(s, quoted, len, plen, max, linemax, 1); +@@ -1191,7 +1213,35 @@ + l--; + setcursor(vlen(s, --cx), plen, max, linemax); + } +- else if (len < max) { ++ else if (len + hlen - i < max) { ++ if (home) { ++ setcursor(vlen(s, top), plen, max, linemax); ++ deletechar(s, top, len, plen, max, linemax, i); ++ delshift(s, top, len, i); ++ len -= i; ++ l -= i; ++ cx -= i; ++ i = insertstr(s, top, len, plen, max, linemax, ++ home, hlen, '\0'); ++ len += i; ++ l += i; ++ cx += i; ++ free(home); ++ } ++# if !MSDOS || !defined (_NOORIGSHELL) ++ if (hadmeta) for (i = top; i < cx; i++) { ++ if (iskanji1(s, i)) { ++ i++; ++ continue; ++ } ++ if (!isnmeta(s, i, '\0', cx)) continue; ++ setcursor(vlen(s, i), plen, max, linemax); ++ deletechar(s, i, len, plen, max, linemax, 1); ++ delshift(s, i, len--, 1); ++ l--; ++ cx--; ++ } ++# endif /* !MSDOS || !_NOORIGSHELL */ + setcursor(vlen(s, top), plen, max, linemax); + insertchar(s, top, len, plen, max, linemax, 1); + insshift(s, top, len++, 1); +diff -u ../old/FD-2.01b/pathname.c ./pathname.c +--- ../old/FD-2.01b/pathname.c Wed Jul 10 00:00:00 2002 ++++ ./pathname.c Mon Jul 29 13:40:14 2002 +@@ -178,7 +178,6 @@ + static int NEAR replacevar __P_((char *, char **, int, int, int, int)); + static char *NEAR insertarg __P_((char *, int, char *, int, int)); + static int NEAR evalvar __P_((char **, int, char **, int)); +-static int NEAR evalhome __P_((char **, int, char **)); + + #ifdef LSI_C + #include <jctype.h> +@@ -2480,7 +2479,7 @@ + return(NULL); + } + +-static int NEAR evalhome(bufp, ptr, argp) ++int evalhome(bufp, ptr, argp) + char **bufp; + int ptr; + char **argp; +diff -u ../old/FD-2.01b/pathname.h ./pathname.h +--- ../old/FD-2.01b/pathname.h Wed Jul 10 00:00:00 2002 ++++ ./pathname.h Mon Jul 29 13:39:48 2002 +@@ -161,6 +161,7 @@ + # endif + #endif + extern char *gethomedir __P_((VOID_A)); ++extern int evalhome __P_((char **, int, char **)); + extern char *evalarg __P_((char *, int, int)); + extern int evalifs __P_((int, char ***, char *)); + extern int evalglob __P_((int, char ***, int)); + +A patch taken from: [FDclone-users:00035] + +diff -u old/input.c ./input.c +--- old/input.c Wed Aug 21 14:19:15 2002 ++++ ./input.c Wed Aug 21 14:08:27 2002 +@@ -852,52 +852,78 @@ + dupl = malloc2(ins * 2 + 1); + insertchar(s, cx, len, plen, max, linemax, vlen(strins, ins)); + insshift(s, cx, len, ins); ++ for (i = 0; i < ins; i++) s[cx + i] = ' '; ++ len += ins; + for (i = j = 0; i < ins; i++, j++) { + if (isctl(strins[i])) { +- if (len + ins + j - i >= max) ++ if (len + j - i >= max) + dupl[j] = s[cx + j] = '?'; + else { ++ insertchar(s, cx, len, plen, max, linemax, 1); ++ insshift(s, cx + j, len, 1); + dupl[j] = '^'; + s[cx + j] = QUOTE; +- dupl[++j] = (strins[i] + '@') & 0x7f; ++ j++; ++ dupl[j] = (strins[i] + '@') & 0x7f; + s[cx + j] = strins[i]; + } + } + #ifdef CODEEUC + else if (isekana(strins, i)) { +- if (len + ins + j - i >= max) ++ if (len + j - i >= max) + dupl[j] = s[cx + j] = '?'; + else { + dupl[j] = s[cx + j] = strins[i]; +- dupl[j + 1] = s[cx + j + 1] = strins[++i]; + j++; ++ dupl[j] = s[cx + j] = strins[++i]; + } + } + #endif + else if (iskanji1(strins, i)) { +- if (len + ins + j - i >= max) ++ if (len + j - i >= max) + dupl[j] = s[cx + j] = '?'; + else { + dupl[j] = s[cx + j] = strins[i]; +- dupl[j + 1] = s[cx + j + 1] = strins[++i]; + j++; ++ dupl[j] = s[cx + j] = strins[++i]; + } + } + #if MSDOS && defined (_NOORIGSHELL) +- else if (strchr(DQ_METACHAR, strins[i])) { ++ else if (strchr(DQ_METACHAR, strins[i]) + #else +- else if (quote == '"' && strchr(DQ_METACHAR, strins[i])) { ++ else if ((quote == '\'' && strins[i] == '\'') ++ || (quote == '"' && strins[i] == '!')) { ++ f = 3; ++ if (!strins[i + 1]) f--; ++ if (len + j - i + f > max) ++ dupl[j] = s[cx + j] = '?'; ++ else { ++ insertchar(s, cx, len, plen, max, linemax, f); ++ insshift(s, cx + j, len, f); ++ dupl[j] = s[cx + j] = quote; ++ j++; ++ dupl[j] = s[cx + j] = PMETA; ++ j++; ++ dupl[j] = s[cx + j] = strins[i]; ++ j++; ++ dupl[j] = s[cx + j] = quote; ++ } ++ } ++ else if ((quote == '"' && strchr(DQ_METACHAR, strins[i])) + #endif +- if (len + ins + j - i >= max) ++ || (!quote && strchr(METACHAR, strins[i]))) { ++ if (len + j - i >= max) + dupl[j] = s[cx + j] = '?'; + else { ++ insertchar(s, cx, len, plen, max, linemax, 1); ++ insshift(s, cx + j, len, 1); + #if MSDOS && defined (_NOORIGSHELL) +- dupl[j] = s[cx + j] = ++ dupl[j] = s[cx + j] = strins[i]; + #else + dupl[j] = s[cx + j] = PMETA; + #endif +- dupl[j + 1] = s[cx + j + 1] = strins[i]; + j++; ++ dupl[j] = s[cx + j] = strins[i]; + } + } + else dupl[j] = s[cx + j] = strins[i]; +@@ -1235,6 +1261,7 @@ + continue; + } + if (!isnmeta(s, i, '\0', cx)) continue; ++ if (strchr(DQ_METACHAR, s[i + 1])) continue; + setcursor(vlen(s, i), plen, max, linemax); + deletechar(s, i, len, plen, max, linemax, 1); + delshift(s, i, len--, 1); +@@ -1254,15 +1281,12 @@ + } + + cp2 = cp1 + (int)strlen(cp1) - ins; +- if (fix == _SC_) { +- ins--; +- if (!hasmeta) quote = '\0'; +- } ++ if (fix == _SC_) ins--; + i = insertstr(s, cx, len, plen, max, linemax, cp2, ins, quote); + l += i; + if (fix && (len += i) < max) { + cx += i; +- if (quote && len + 1 < max) { ++ if (quote && len + 1 < max && (fix != _SC_ || hasmeta)) { + insertchar(s, cx, len, plen, max, linemax, 1); + insshift(s, cx, len++, 1); + l++; |