Imported Upstream version 1.4
[debian/gzip] / lib / open.c
index 8027b473a5a385816248b638a486abce5071aaf5..f612b802d2185505b2aa19cc72290ab790190cba 100644 (file)
@@ -1,5 +1,5 @@
 /* Open a descriptor to a file.
-   Copyright (C) 2007-2009 Free Software Foundation, Inc.
+   Copyright (C) 2007-2010 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -57,7 +57,7 @@ open (const char *filename, int flags, ...)
       va_start (arg, flags);
 
       /* We have to use PROMOTED_MODE_T instead of mode_t, otherwise GCC 4
-        creates crashing code when 'mode_t' is smaller than 'int'.  */
+         creates crashing code when 'mode_t' is smaller than 'int'.  */
       mode = va_arg (arg, PROMOTED_MODE_T);
 
       va_end (arg);
@@ -94,10 +94,10 @@ open (const char *filename, int flags, ...)
     {
       size_t len = strlen (filename);
       if (len > 0 && filename[len - 1] == '/')
-       {
-         errno = EISDIR;
-         return -1;
-       }
+        {
+          errno = EISDIR;
+          return -1;
+        }
     }
 #endif
 
@@ -144,16 +144,16 @@ open (const char *filename, int flags, ...)
       /* We know len is positive, since open did not fail with ENOENT.  */
       size_t len = strlen (filename);
       if (filename[len - 1] == '/')
-       {
-         struct stat statbuf;
-
-         if (fstat (fd, &statbuf) >= 0 && !S_ISDIR (statbuf.st_mode))
-           {
-             close (fd);
-             errno = ENOTDIR;
-             return -1;
-           }
-       }
+        {
+          struct stat statbuf;
+
+          if (fstat (fd, &statbuf) >= 0 && !S_ISDIR (statbuf.st_mode))
+            {
+              close (fd);
+              errno = ENOTDIR;
+              return -1;
+            }
+        }
     }
 #endif