projects
/
gnulib.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
open, openat: minor optimization
[gnulib.git]
/
lib
/
openat.c
diff --git
a/lib/openat.c
b/lib/openat.c
index
7e46a26
..
079039f
100644
(file)
--- a/
lib/openat.c
+++ b/
lib/openat.c
@@
-103,8
+103,9
@@
rpl_openat (int dfd, char const *filename, int flags, ...)
with ENOTDIR. */
if (fd >= 0)
{
with ENOTDIR. */
if (fd >= 0)
{
+ /* We know len is positive, since open did not fail with ENOENT. */
size_t len = strlen (filename);
size_t len = strlen (filename);
- if (
len > 0 &&
filename[len - 1] == '/')
+ if (filename[len - 1] == '/')
{
struct stat statbuf;
{
struct stat statbuf;