#include "journal-file.h"
#include "hashmap.h"
#include "list.h"
+#include "path-util.h"
#include "lookup3.h"
#include "compress.h"
#include "journal-internal.h"
return -EINVAL;
if (!data)
return -EINVAL;
- if (size <= 0)
+ if (size <= 1)
return -EINVAL;
+ if (!memchr(data, '=', size))
+ return -EINVAL;
+ if (*(char*) data == '=')
+ return -EINVAL;
+
+ /* FIXME: iterating with multiple matches is currently
+ * broken */
+ if (j->matches)
+ return -ENOTSUP;
le_hash = htole64(hash64(data, size));
bid, (unsigned long long) le64toh(o->entry.monotonic),
(unsigned long long) le64toh(o->entry.realtime),
(unsigned long long) le64toh(o->entry.xor_hash),
- file_name_from_path(j->current_file->path)) < 0)
+ path_get_file_name(j->current_file->path)) < 0)
return -ENOMEM;
return 1;