From a1710fccd70b561397affa9e3ce93e1e23ac2a71 Mon Sep 17 00:00:00 2001 From: fbt Date: Sat, 28 Nov 2026 05:12:54 +0000 Subject: [PATCH] We need to check the exit code of file Signed-off-by: fbt --- sx-open | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sx-open b/sx-open index 810ac89..10d8fe2 100755 --- a/sx-open +++ b/sx-open @@ -118,12 +118,14 @@ handle_target() { [[ "$target" =~ ^/.* ]] || { target="${PWD}/${target}"; } # Turn relative paths to absolute ones. - IFS=';' read target_mimetype _ <<< $( file -ib "$target" ) + file_raw=$( file -ib "$target" ) (( $? )) && { error "Failed to get mimetype, bailing" return 1 } + IFS=';' read target_mimetype _ <<< "$file_raw" + target_left=$target_mimetype [[ $target_mimetype == 'inode/symlink' ]] && \