Am Fri, Apr 19, 2024 at 08:43:37AM +0200 schrieb Martin Ziemer:
> Am Fri, Apr 12, 2024 at 10:52:42AM +0200 schrieb Martin Ziemer:
> > There is a bug in nnn 4.9 which prevents it from creating new files. 
> > (It uses none of the required modes to open a file)
> > 
> > The Fix is committed Upstream (Commit 
> > 28d993a8e85651e6e8a61b410472febc6069ceb0)
> > 
> > I think, we should include the Fix in our Version of nnn until next
> > update of the upstream version.

Index: Makefile
===================================================================
RCS file: /cvs/ports/sysutils/nnn/Makefile,v
retrieving revision 1.26
diff -u -p -r1.26 Makefile
--- Makefile    27 Sep 2023 17:16:31 -0000      1.26
+++ Makefile    4 Apr 2024 13:28:13 -0000
@@ -3,6 +3,7 @@ COMMENT =               the missing terminal file bro
 V =                    4.9
 DISTNAME =             nnn-v${V}
 PKGNAME =              nnn-${V}
+REVISION =             0
 
 CATEGORIES =           sysutils
 
Index: patches/patch-src_nnn_c
===================================================================
RCS file: patches/patch-src_nnn_c
diff -N patches/patch-src_nnn_c
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_nnn_c     4 Apr 2024 13:28:13 -0000
@@ -0,0 +1,14 @@
+Fix creation of Files
+
+Index: src/nnn.c
+--- src/nnn.c.orig
++++ src/nnn.c
+@@ -4692,7 +4692,7 @@ next:
+                       return FALSE;
+               }
+       } else {
+-              int fd = open(path, O_CREAT | O_TRUNC, S_IWUSR | S_IRUSR); /* 
Forced create mode for files */
++              int fd = open(path, O_WRONLY | O_CREAT | O_TRUNC, S_IWUSR | 
S_IRUSR); /* Forced create mode for files */
+ 
+               if (fd == -1 && errno != EEXIST) {
+                       DPRINTF_S("open!");

Reply via email to