[PHP-DEV] CVS update: php3/functions From: rasmus (php-dev <email protected>)
Date: 08/13/98

Date: Thursday August 13, 1998 @ 14:54
Author: rasmus

Update of /repository/php3/functions
In directory asf:/export/home/rasmus/php3/functions

Modified Files:
        filestat.c
Log Message:
Bug #652 fix

Index: php3/functions/filestat.c
diff -c php3/functions/filestat.c:1.73 php3/functions/filestat.c:1.74
*** php3/functions/filestat.c:1.73 Tue Aug 11 23:09:07 1998
--- php3/functions/filestat.c Thu Aug 13 14:54:39 1998
***************
*** 27,33 ****
     +----------------------------------------------------------------------+
   */
  
! /* $Id: filestat.c,v 1.73 1998/08/12 03:09:07 steffann Exp $ */
  #ifdef THREAD_SAFE
  #include "tls.h"
  #endif
--- 27,33 ----
     +----------------------------------------------------------------------+
   */
  
! /* $Id: filestat.c,v 1.74 1998/08/13 18:54:39 rasmus Exp $ */
  #ifdef THREAD_SAFE
  #include "tls.h"
  #endif
***************
*** 442,447 ****
--- 442,453 ----
                  RETURN_LONG((long)GLOBAL(sb).st_ctime);
                  break;
          case 8: /* filetype */
+ {
+ struct stat lsb;
+ lstat(GLOBAL(CurrentStatFile),&lsb);
+ if ((lsb.st_mode&S_IFMT) == S_IFLNK) {
+ RETURN_STRING("link",1);
+ }
                  switch(GLOBAL(sb).st_mode&S_IFMT) {
                  case S_IFIFO:
                          RETURN_STRING("fifo",1);
***************
*** 456,472 ****
                          RETURN_STRING("block",1);
                          break;
                  case S_IFREG:
- lstat(GLOBAL(CurrentStatFile),&GLOBAL(sb));
- if ((GLOBAL(sb).st_mode&S_IFMT) == S_IFLNK) {
- RETURN_STRING("link",1);
- } else {
                                  RETURN_STRING("file",1);
- }
                          break;
                  default:
                          php3_error(E_WARNING,"Unknown file type (%d)",GLOBAL(sb).st_mode&S_IFMT);
                          RETURN_STRING("unknown",1);
                          break;
                  }
                  break;
          case 9: /*is writable*/
--- 462,474 ----
                          RETURN_STRING("block",1);
                          break;
                  case S_IFREG:
                                  RETURN_STRING("file",1);
                          break;
                  default:
                          php3_error(E_WARNING,"Unknown file type (%d)",GLOBAL(sb).st_mode&S_IFMT);
                          RETURN_STRING("unknown",1);
                          break;
+ }
                  }
                  break;
          case 9: /*is writable*/

--
PHP Development Mailing List   http://www.php.net/
To unsubscribe send an empty message to php-dev-unsubscribe <email protected>
For help: php-dev-help <email protected>