Karim BELABAS on Wed, 18 Nov 1998 12:31:27 +0100 (MET)


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

2.0.12.alpha, patch 2


This patch corrects a typo which caused \r / read() to fail with bizarre
error messages, when trying to access a non-existent file (on some Linux
systems) [name was freed before being used].

Karim.

*** src/language/es.c.orig	Fri Nov  6 16:08:52 1998
--- src/language/es.c	Wed Nov 18 12:25:51 1998
***************
*** 2043,2059 ****
  
  /* If name = "", re-read last file */
  void
! switchin(char *name)
  {
!   char *s;
  
!   if (*name)
!     name = expand_tilde(name);
    else
    {
      if (last_filename == NULL)
        err(talker,"You never gave me anything to read!");
!     name = pari_strdup(last_filename);
    }
    /* if name contains '/',  don't use dir_list */
    s=name; while (*s && *s != '/') s++;
--- 2043,2060 ----
  
  /* If name = "", re-read last file */
  void
! switchin(char *name0)
  {
!   char *s, *name;
  
!   if (*name0)
!     name = expand_tilde(name0);
    else
    {
      if (last_filename == NULL)
        err(talker,"You never gave me anything to read!");
!     name0 = last_filename;
!     name = pari_strdup(name0);
    }
    /* if name contains '/',  don't use dir_list */
    s=name; while (*s && *s != '/') s++;
***************
*** 2068,2074 ****
        if (try_name(s)) return;
      }
    }
!   err(openfiler,"input",name);
  }
  
  void
--- 2069,2075 ----
        if (try_name(s)) return;
      }
    }
!   err(openfiler,"input",name0);
  }
  
  void

--
Karim Belabas                    email: Karim.Belabas@math.u-psud.fr
Dep. de Mathematiques, Bat. 425
Universite Paris-Sud             Tel: (00 33) 1 69 15 57 48
F-91405 Orsay (France)           Fax: (00 33) 1 69 15 60 19
--
PARI/GP Home Page: http://pari.home.ml.org