#include "alloc-util.h"
#include "architecture.h"
+#include "def.h"
#include "fd-util.h"
#include "fileio.h"
#include "fs-util.h"
_cleanup_free_ char *b = NULL;
_cleanup_free_ const char *fn = NULL;
const char *c = NULL;
- char line[LINE_MAX];
size_t n;
int r;
* xdg-user-dirs does upstream */
n = strlen(field);
- FOREACH_LINE(line, f, return -errno) {
+ for (;;) {
+ _cleanup_free_ char *line = NULL;
char *l, *p, *e;
+ r = read_line(f, LONG_LINE_MAX, &line);
+ if (r < 0)
+ return r;
+ if (r == 0)
+ break;
+
l = strstrip(line);
if (!strneq(l, field, n))