Branch: Tag:

1998-02-01

1998-02-01 02:08:25 by Fredrik Hübinette (Hubbe) <hubbe@hubbe.net>

Many patches for NT...

Rev: NT/tools/cp:1.3
Rev: NT/tools/install:1.3
Rev: NT/tools/lib:1.12
Rev: NT/tools/mkdir:1.3
Rev: NT/tools/rntcc:1.10
Rev: NT/tools/sprsh:1.2
Rev: NT/tools/sprshd:1.6
Rev: src/builtin_functions.c:1.66
Rev: src/error.c:1.12
Rev: src/error.h:1.12
Rev: src/fdlib.c:1.11
Rev: src/fdlib.h:1.8
Rev: src/interpret.c:1.65
Rev: src/modules/files/file.c:1.73
Rev: src/modules/files/socket.c:1.28
Rev: src/pike_memory.c:1.12
Rev: src/program.h:1.31
Rev: src/signal_handler.c:1.28

4:   ||| See the files COPYING and DISCLAIMER for more information.   \*/   #include "global.h" - RCSID("$Id: builtin_functions.c,v 1.65 1998/01/30 06:19:50 hubbe Exp $"); + RCSID("$Id: builtin_functions.c,v 1.66 1998/02/01 02:07:22 hubbe Exp $");   #include "interpret.h"   #include "svalue.h"   #include "pike_macros.h"
356:   #define IS_ABS(X) (IS_SEP((X)[0])?1:0)   #else   #define IS_SEP(X) ( (X) == '/' || (X) == '\\' ) - #define IS_ABS(X) (IS_SEP((X)[0])?1:(isalpha((X)[0]) && (X)[1]==':' && IS_SEP((X)[2]))?3:0) + #define IS_ABS(X) ((isalpha((X)[0]) && (X)[1]==':' && IS_SEP((X)[2]))?3:0) + #define IS_ROOT(X) (IS_SEP((X)[0])?1:0)   #endif      static char *combine_path(char *cwd,char *file)
369:    my_cwd=0;       -  if(IS_ABS(file)) +  if(IS_ABS(file) + #ifdef IS_ROOT +  || ( IS_ROOT(file) && !IS_ABS(cwd)) + #endif +  )    {    MEMCPY(cwdbuf,file,IS_ABS(file));    cwdbuf[IS_ABS(file)]=0;    cwd=cwdbuf;    file+=IS_ABS(file);    } -  +  + #ifdef IS_ROOT +  else if(IS_ROOT(file) && IS_ABS(cwd)) +  { +  MEMCPY(cwdbuf,cwd,IS_ABS(cwd)); +  cwdbuf[IS_ABS(cwd)]=0; +  cwd=cwdbuf; +  file+=IS_ROOT(file); +  } + #endif +    #ifdef DEBUG    if(!cwd)    fatal("No cwd in combine_path!\n");