*d = '(';
if (r)
err(EXIT_FAILURE, _("failed to add output data"));
+ if (uri) {
+ struct libscols_cell *ce = scols_line_get_cell(ln, column_index);
+ if (ce)
+ scols_cell_disable_uri(ce, 1);
+ }
return true;
}
}
ftype = file->stat.st_mode & S_IFMT;
if (uri && (!file->name || *file->name != '/'
- || (ftype != S_IFREG && ftype != S_IFDIR))) {
+ || (ftype != S_IFREG && ftype != S_IFDIR)
+ || file->stat.st_nlink == 0)) {
struct libscols_cell *ce = scols_line_get_cell(ln, column_index);
if (ce)
scols_cell_disable_uri(ce, 1);
--- /dev/null
+# NAME
+00000000 2e 2f 74 6d 70 2d 6f 70 74 69 6f 6e 2d 68 79 70 |./tmp-option-hyp|
+00000010 65 72 6c 69 6e 6b 20 0a |erlink .|
+00000018
+# KNAME
+00000000 2e 2f 74 6d 70 2d 6f 70 74 69 6f 6e 2d 68 79 70 |./tmp-option-hyp|
+00000010 65 72 6c 69 6e 6b 20 28 64 65 6c 65 74 65 64 29 |erlink (deleted)|
+00000020 0a |.|
+00000021
sed -e 's@file://'"${HOSTNAME_PATTERN}"'/@file:///@'
}
+replace_filename()
+{
+ # Make the output PWD independent:
+ sed -e 's@'"$TS_OUTDIR"'@.@g'
+}
+
ts_cd "$TS_OUTDIR"
PID=
FD=3
wait "${MKFDS_PID}"
ts_finalize_subtest
+ts_init_subtest "deleted-file"
+{
+ coproc MKFDS { "$TS_HELPER_MKFDS" make-regular-file $FD file=tmp-option-hyperlink delete=true; }
+ if read -r -u "${MKFDS[0]}" PID; then
+ for o in NAME KNAME; do
+ echo "# $o"
+ "${TS_CMD_LSFD}" -n --hyperlink=always -o "$o" -p "${PID}" -Q "$EXPR" \
+ | replace_hostname \
+ | replace_filename \
+ | "$TS_CMD_HEXDUMP" -C
+ done
+ echo DONE >&"${MKFDS[1]}"
+ fi
+} > "$TS_OUTPUT" 2>&1
+wait "${MKFDS_PID}"
+ts_finalize_subtest
+
ts_finalize