open, openat: minor optimization
[pspp] / lib / open.c
index 08ecaff44b49efb636931828e54b6b89861445d8..7cc25bd07c9511f94b87fce85c442d35e5fb92b0 100644 (file)
@@ -141,8 +141,9 @@ open (const char *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;