Changeset 1015


Ignore:
Timestamp:
2000-03-06T11:49:42+13:00 (23 years ago)
Author:
sjboddie
Message:

oops, now it's fixed I think

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/packages/mg/src/text/read_line.c

    r1014 r1015  
    4949}
    5050#else
     51
     52static FILE *rl_instream = NULL;
     53static FILE *rl_outstream = NULL;
     54
    5155void
    5256Init_ReadLine (void)
     
    5559  rl_outstream = stdout;
    5660}
    57 #endif
    58 
    59 
    60 
     61
     62static char *
     63readline (char *pmt)
     64{
     65  static char buf[MAXLINEBUFFERLEN + 1];
     66  char *s;
     67
     68  fprintf (rl_outstream, "%s", pmt);
     69  s = fgets (buf, sizeof (buf), rl_instream);
     70  if (s)
     71    {
     72      char *s1 = strrchr (s, '\n');
     73      if (s1 && *(s1 + 1) == '\0')
     74    *s1 = '\0';
     75    }
     76  return s ? Xstrdup (s) : NULL;
     77}
     78#endif
    6179
    6280/* WritePrompt() */
     
    112130#endif
    113131
    114 
    115 #ifndef GNU_READLINE
    116 
    117 static FILE *rl_instream = NULL;
    118 static FILE *rl_outstream = NULL;
    119 
    120 static char *
    121 readline (char *pmt)
    122 {
    123   static char buf[MAXLINEBUFFERLEN + 1];
    124   char *s;
    125 
    126   fprintf (rl_outstream, "%s", pmt);
    127   s = fgets (buf, sizeof (buf), rl_instream);
    128   if (s)
    129     {
    130       char *s1 = strrchr (s, '\n');
    131       if (s1 && *(s1 + 1) == '\0')
    132     *s1 = '\0';
    133     }
    134   return s ? Xstrdup (s) : NULL;
    135 }
    136 #endif
    137132
    138133/*
Note: See TracChangeset for help on using the changeset viewer.