* lib/openat2.c (do_openat2): Don't use an expression with side effects
as argument of ISSLASH.
+2025-11-01 Bruno Haible <bruno@clisp.org>
+
+ openat2: Fix invalid memory access on Cygwin.
+ * lib/openat2.c (do_openat2): Don't use an expression with side effects
+ as argument of ISSLASH.
+
2025-11-01 Bruno Haible <bruno@clisp.org>
openat2 tests: Avoid gratuitous test failure when debugging.
}
}
idx_t h = g;
- while (1 < h && !ISSLASH (e[- --h]))
- continue;
+ while (h > 1)
+ {
+ h--;
+ if (ISSLASH (e[-h]))
+ break;
+ }
/* Properties of the file name through the first component's end,
or to file name end if there is no component. */