projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
open, openat: minor optimization
[pspp]
/
lib
/
openat.c
diff --git
a/lib/openat.c
b/lib/openat.c
index 7e46a2672be613f948bae41dd30b78de4ed63b45..079039fee3a40d29377c1b9e8463e970f87601b6 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)
{
+ /* We know len is positive, since open did not fail with ENOENT. */
size_t len = strlen (filename);
- if (
len > 0 &&
filename[len - 1] == '/')
+ if (filename[len - 1] == '/')
{
struct stat statbuf;