diff --git a/src/fdlib.c b/src/fdlib.c index b5de1ff136cdda2577ab7e8e31067a388c759a36..40d488fd73f08f78788b0015a4b23cc2c1daac06 100644 --- a/src/fdlib.c +++ b/src/fdlib.c @@ -3,7 +3,7 @@ #include "error.h" #include <math.h> -RCSID("$Id: fdlib.c,v 1.16 1998/03/28 15:37:24 grubba Exp $"); +RCSID("$Id: fdlib.c,v 1.17 1998/05/01 15:31:23 hubbe Exp $"); #ifdef HAVE_WINSOCK_H @@ -157,6 +157,9 @@ FD fd_open(char *file, int open_mode, int create_mode) mt_unlock(&fd_mutex); + if(open_mode & fd_APPEND) + fd_lseek(fd,0,SEEK_END); + FDDEBUG(fprintf(stderr,"Opened %s file as %d (%d)\n",file,fd,x)); return fd; diff --git a/src/signal_handler.c b/src/signal_handler.c index f816d8a5688d817fc1263e285eee9dc90d37724c..c17081fcd2244aa460e995e6dd222f0decc3867a 100644 --- a/src/signal_handler.c +++ b/src/signal_handler.c @@ -22,7 +22,7 @@ #include "builtin_functions.h" #include <signal.h> -RCSID("$Id: signal_handler.c,v 1.57 1998/04/30 16:29:56 hubbe Exp $"); +RCSID("$Id: signal_handler.c,v 1.58 1998/05/01 15:32:10 hubbe Exp $"); #ifdef HAVE_PASSWD_H # include <passwd.h> @@ -735,26 +735,46 @@ void f_create_process(INT32 args) void *env=NULL; /* Quote command to allow all characters (if possible) */ + /* Damn! NT doesn't have quoting! The below code attempts to + * fake it + */ { int e,d; dynamic_buffer buf; initialize_buf(&buf); for(e=0;e<cmd->size;e++) { - if(e) low_my_putchar(' ', &buf); - low_my_putchar('"', &buf); - for(d=0;d<ITEM(cmd)[e].u.string->len;d++) + int quote; + if(e) { - switch(ITEM(cmd)[e].u.string->str[d]) + low_my_putchar(' ', &buf); + quote=STRCHR(ITEM(cmd)[e].u.string->str,'"') || + STRCHR(ITEM(cmd)[e].u.string->str,' '); + }else{ + quote=0; + } + + if(quote) + { + low_my_putchar('"', &buf); + + for(d=0;d<ITEM(cmd)[e].u.string->len;d++) { - case '"': - case '\\': - low_my_putchar('\\', &buf); - default: - low_my_putchar(ITEM(cmd)[e].u.string->str[d], &buf); + switch(ITEM(cmd)[e].u.string->str[d]) + { + case '"': + case '\\': + low_my_putchar('\\', &buf); + default: + low_my_putchar(ITEM(cmd)[e].u.string->str[d], &buf); + } } + low_my_putchar('"', &buf); + }else{ + low_my_binary_strcat(ITEM(cmd)[e].u.string->str, + ITEM(cmd)[e].u.string->len, + &buf); } - low_my_putchar('"', &buf); } low_my_putchar(0, &buf); command_line=(TCHAR *)buf.s.str;