X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=plocate.cpp;h=079eb2996cf40e7d4a8c3fe5b1d37d7485e6f9a7;hb=acce03bb32917e21f2d1d49c5a460d3cd2f72a11;hp=c06a28bf2dd24a233c7d8a2726822bc23cd6d8cc;hpb=f1da1926bc221976ed8daf90f6c4fea9893f4d0b;p=plocate diff --git a/plocate.cpp b/plocate.cpp index c06a28b..079eb29 100644 --- a/plocate.cpp +++ b/plocate.cpp @@ -1,4 +1,5 @@ #include "access_rx_cache.h" +#include "complete_pread.h" #include "db.h" #include "dprintf.h" #include "io_uring_engine.h" @@ -55,6 +56,7 @@ bool use_extended_regex = false; bool match_basename = false; int64_t limit_matches = numeric_limits::max(); int64_t limit_left = numeric_limits::max(); +bool stdout_is_tty = false; steady_clock::time_point start; ZSTD_DDict *ddict = nullptr; @@ -767,6 +769,10 @@ int main(int argc, char **argv) } } + if (!print_nul) { + stdout_is_tty = isatty(1); + } + vector needles; for (int i = optind; i < argc; ++i) { Needle needle;