diff --git a/library/changes b/library/changes index c95dee5..f631c75 100644 --- a/library/changes +++ b/library/changes @@ -18,6 +18,13 @@ no requester will appear unless you specifically set the value of the "__no_standard_io" variable to TRUE in your program. +- Removed a misplaced IsInteractive() from the stdio initialization + function. Now this could have been big trouble... + +- Removed tests for FileHandle->fh_Type != NULL which used to precede + all IsInterative() tests. I verified that IsInteractive() will always + return FALSE for NIL: type file handles. + c.lib 1.185 (2.1.2005) diff --git a/library/fcntl_open.c b/library/fcntl_open.c index 46ffeda..b56d883 100644 --- a/library/fcntl_open.c +++ b/library/fcntl_open.c @@ -1,5 +1,5 @@ /* - * $Id: fcntl_open.c,v 1.4 2005-01-02 09:07:07 obarthel Exp $ + * $Id: fcntl_open.c,v 1.5 2005-01-09 09:54:33 obarthel Exp $ * * :ts=4 * @@ -67,7 +67,7 @@ open(const char *path_name, int open_flag, ... /* mode_t mode */ ) struct FileHandle * file_handle; BPTR handle = ZERO; BOOL create_new_file = FALSE; - LONG is_interactive = FALSE; + LONG is_interactive; int fd_slot_number; struct fd * fd; int access_mode; @@ -344,10 +344,7 @@ open(const char *path_name, int open_flag, ... /* mode_t mode */ ) /* Figure out if this stream is attached to a console. */ PROFILE_OFF(); - - if(file_handle->fh_Type != NULL) - is_interactive = IsInteractive(handle); - + is_interactive = IsInteractive(handle); PROFILE_ON(); if(is_interactive) diff --git a/library/stdio_init_exit.c b/library/stdio_init_exit.c index d9241b7..d80af2f 100644 --- a/library/stdio_init_exit.c +++ b/library/stdio_init_exit.c @@ -1,5 +1,5 @@ /* - * $Id: stdio_init_exit.c,v 1.7 2005-01-08 10:21:25 obarthel Exp $ + * $Id: stdio_init_exit.c,v 1.8 2005-01-09 09:54:33 obarthel Exp $ * * :ts=4 * @@ -113,6 +113,8 @@ __stdio_init(void) ENTER(); + ASSERT( num_standard_files == (STDERR_FILENO-STDIN_FILENO+1) ); + __iob = malloc(sizeof(*__iob) * num_standard_files); if(__iob == NULL) goto out; @@ -183,11 +185,9 @@ __stdio_init(void) /* Check if this stream is attached to a console window. */ if(default_file != ZERO) { - struct FileHandle * fh = BADDR(default_file); - PROFILE_OFF(); - if(fh->fh_Type != NULL && IsInteractive(default_file)) + if(IsInteractive(default_file)) SET_FLAG(fd_flags,FDF_IS_INTERACTIVE); PROFILE_ON(); @@ -257,9 +257,7 @@ __stdio_init(void) /* Figure out if the standard error stream is bound to a console. */ if(__fd[STDERR_FILENO]->fd_DefaultFile != ZERO) { - struct FileHandle * fh = BADDR(IsInteractive(__fd[STDERR_FILENO]->fd_DefaultFile)); - - if(fh->fh_Type != NULL && IsInteractive(__fd[STDERR_FILENO]->fd_DefaultFile)) + if(IsInteractive(__fd[STDERR_FILENO]->fd_DefaultFile)) SET_FLAG(__fd[STDERR_FILENO]->fd_Flags,FDF_IS_INTERACTIVE); }