linux-qubasis

linux oasis port as a qubes template

git clone https://9o.is/git/linux-qubasis.git

commit 8e5b3b7ddf6141f5a88598f8a59152589d20c66d
parent 477c96d55e4e56de7b408a601f962890be1cfd9a
Author: Jul <jul@9o.is>
Date:   Sun,  3 Aug 2025 22:46:06 -0400

noice: add handle regular file init patch

Diffstat:
Mpkg/noice/patches/0001-nopen-exec-file-instead.patch | 2+-
Mpkg/noice/patches/0002-add-picker-flag.patch | 2+-
Apkg/noice/patches/0003-handle-regular-file-path-init.patch | 68++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 70 insertions(+), 2 deletions(-)

diff --git a/pkg/noice/patches/0001-nopen-exec-file-instead.patch b/pkg/noice/patches/0001-nopen-exec-file-instead.patch @@ -1,7 +1,7 @@ From d2cf272d7ebd41e37405df40af08a8d93146ed27 Mon Sep 17 00:00:00 2001 From: Jul <jul@qh.is> Date: Wed, 30 Jul 2025 01:18:08 -0400 -Subject: [PATCH 1/2] nopen exec file instead +Subject: [PATCH 1/3] nopen exec file instead --- nopen.c | 2 +- diff --git a/pkg/noice/patches/0002-add-picker-flag.patch b/pkg/noice/patches/0002-add-picker-flag.patch @@ -1,7 +1,7 @@ From 1d0aa7bb7162a9b34bf1ea7e6767e802058f9cb4 Mon Sep 17 00:00:00 2001 From: Jul <jul@qh.is> Date: Wed, 30 Jul 2025 02:18:47 -0400 -Subject: [PATCH 2/2] add picker flag +Subject: [PATCH 2/3] add picker flag --- noice.c | 14 +++++++++++--- diff --git a/pkg/noice/patches/0003-handle-regular-file-path-init.patch b/pkg/noice/patches/0003-handle-regular-file-path-init.patch @@ -0,0 +1,68 @@ +From b8fdd4099c3dcfe1208a32c6cd16873111a3136e Mon Sep 17 00:00:00 2001 +From: Jul <jul@qh.is> +Date: Sun, 3 Aug 2025 22:44:37 -0400 +Subject: [PATCH 3/3] handle regular file path init + +--- + noice.c | 29 ++++++++++++++++++++++------- + 1 file changed, 22 insertions(+), 7 deletions(-) + +diff --git a/noice.c b/noice.c +index 66ad1e9..0d469ae 100644 +--- a/noice.c ++++ b/noice.c +@@ -132,6 +132,19 @@ xgetenv(char *name, char *fallback) + return value && value[0] ? value : fallback; + } + ++int filetype(char *path) { ++ int fd = open(path, O_RDONLY | O_NONBLOCK); ++ if (fd == -1) return 0; ++ ++ struct stat sb; ++ int r = fstat(fd, &sb); ++ ++ close(fd); ++ if (r == -1) return 0; ++ ++ return sb.st_mode & S_IFMT; ++} ++ + int + setfilter(regex_t *regex, char *filter) + { +@@ -579,9 +592,17 @@ browse(char *ipath, char *ifilter) + regex_t re; + int r, fd; + +- strlcpy(path, ipath, sizeof(path)); + strlcpy(fltr, ifilter, sizeof(fltr)); + oldpath[0] = '\0'; ++ ++ if (filetype(ipath) == S_IFREG) { ++ char *dirp = xdirname(ipath); ++ strlcpy(path, dirp, sizeof(path)); ++ strlcpy(oldpath, ipath, sizeof(oldpath)); ++ } else { ++ strlcpy(path, ipath, sizeof(path)); ++ } ++ + begin: + r = populate(path, oldpath, fltr); + if (r == -1) { +@@ -846,12 +867,6 @@ main(int argc, char *argv[]) + + signal(SIGINT, SIG_IGN); + +- /* Test initial path */ +- if (canopendir(ipath) == 0) { +- fprintf(stderr, "%s: %s\n", ipath, strerror(errno)); +- exit(1); +- } +- + /* Set locale before curses setup */ + setlocale(LC_ALL, ""); + initcurses(); +-- +2.50.1 +