#include "db.h"
+#include "dprintf.h"
#include "io_uring_engine.h"
#include "parse_trigrams.h"
#include "turbopfor.h"
using namespace std;
using namespace std::chrono;
-#define dprintf(...) \
- do { \
- if (use_debug) { \
- fprintf(stderr, __VA_ARGS__); \
- } \
- } while (false)
-
#define DEFAULT_DBPATH "/var/lib/mlocate/plocate.db"
const char *dbpath = DEFAULT_DBPATH;
case 'l':
case 'n':
limit_matches = atoll(optarg);
+ if (limit_matches <= 0) {
+ fprintf(stderr, "Error: limit must be a strictly positive number.\n");
+ exit(1);
+ }
break;
case '0':
print_nul = true;
Needle needle;
needle.str = argv[i];
-
// See if there are any wildcard characters, which indicates we should treat it
// as an (anchored) glob.
bool any_wildcard = false;