aboutsummaryrefslogtreecommitdiffstats
path: root/shells/fd
diff options
context:
space:
mode:
authorknu <knu@FreeBSD.org>2006-04-11 16:12:00 +0800
committerknu <knu@FreeBSD.org>2006-04-11 16:12:00 +0800
commit23be574f61680f0c64354c76495f2746be69b696 (patch)
tree989bad45fd67eb7abf4851ec48e4357b0ebb5e16 /shells/fd
parent58cee636da62f16176c8f5012046cf1cf79b7e8d (diff)
downloadfreebsd-ports-gnome-23be574f61680f0c64354c76495f2746be69b696.tar.gz
freebsd-ports-gnome-23be574f61680f0c64354c76495f2746be69b696.tar.zst
freebsd-ports-gnome-23be574f61680f0c64354c76495f2746be69b696.zip
Add a patch to fix a problem that ~/.fd_history is truncated
when the home directory is on a file system without locking support.
Diffstat (limited to 'shells/fd')
-rw-r--r--shells/fd/Makefile1
-rw-r--r--shells/fd/files/patch-shell.c47
2 files changed, 48 insertions, 0 deletions
diff --git a/shells/fd/Makefile b/shells/fd/Makefile
index 287c36871dbb..2c7f8a728e34 100644
--- a/shells/fd/Makefile
+++ b/shells/fd/Makefile
@@ -7,6 +7,7 @@
PORTNAME= fd
PORTVERSION= 2.08b
+PORTREVISION= 1
CATEGORIES= shells
MASTER_SITES= http://hp.vector.co.jp/authors/VA012337/soft/fd/ \
ftp://ftp.unixusers.net/src/fdclone/
diff --git a/shells/fd/files/patch-shell.c b/shells/fd/files/patch-shell.c
new file mode 100644
index 000000000000..8d79078746b3
--- /dev/null
+++ b/shells/fd/files/patch-shell.c
@@ -0,0 +1,47 @@
+cf. [FDclone-users:00493]
+
+diff -u ../old/FD-2.08b/shell.c ./shell.c
+--- ../old/FD-2.08b/shell.c Thu Mar 30 00:00:00 2006
++++ ./shell.c Mon Apr 10 22:45:35 2006
+@@ -1630,12 +1630,7 @@
+ int i, j, size;
+
+ if (!file || !(fp = Xfopen(file, "r"))) return(-1);
+-#ifndef NOFLOCK
+- if (lockfile(Xfileno(fp), LCK_READ) < 0) {
+- Xfclose(fp);
+- return(-1);
+- }
+-#endif
++ VOID_C lockfile(Xfileno(fp), LCK_READ);
+
+ size = (int)histsize[n];
+ history[n] = (char **)malloc2(sizeof(char *) * (size + 1));
+@@ -1650,7 +1645,7 @@
+ for (j = i; j > 0; j--) history[n][j] = history[n][j - 1];
+ history[n][0] = line;
+ }
+- lockfile(Xfileno(fp), LCK_UNLOCK);
++ VOID_C lockfile(Xfileno(fp), LCK_UNLOCK);
+ Xfclose(fp);
+
+ for (i++; i <= size; i++) history[n][i] = NULL;
+@@ -1684,16 +1679,11 @@
+
+ if (!history[n] || !history[n][0]) return(-1);
+ if (!file || !(fp = Xfopen(file, "w"))) return(-1);
+-#ifndef NOFLOCK
+- if (lockfile(Xfileno(fp), LCK_WRITE) < 0) {
+- Xfclose(fp);
+- return(-1);
+- }
+-#endif
++ VOID_C lockfile(Xfileno(fp), LCK_WRITE);
+
+ size = (savehist > (int)histsize[n]) ? (int)histsize[n] : savehist;
+ for (i = size - 1; i >= 0; i--) convhistory(history[n][i], fp);
+- lockfile(Xfileno(fp), LCK_UNLOCK);
++ VOID_C lockfile(Xfileno(fp), LCK_UNLOCK);
+ Xfclose(fp);
+
+ return(0);