]> git.sesse.net Git - plocate/blobdiff - plocate.cpp
Move complete_pread() into a separate file, to avoid the io_uring false dependency.
[plocate] / plocate.cpp
index c06a28bf2dd24a233c7d8a2726822bc23cd6d8cc..079eb2996cf40e7d4a8c3fe5b1d37d7485e6f9a7 100644 (file)
@@ -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<int64_t>::max();
 int64_t limit_left = numeric_limits<int64_t>::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<Needle> needles;
        for (int i = optind; i < argc; ++i) {
                Needle needle;