home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-386-Vol-2of3.iso / c / csh4.zip / SAVESTR.C < prev    next >
Text File  |  1985-09-03  |  243b  |  14 lines

  1. #define NULL (void *)0
  2. char *
  3. savestr(s)
  4.     register char *s;
  5. {
  6.     register char *r,*malloc();
  7.     /* squirrel away matched file name */
  8.     if (NULL == (r = malloc(strlen(s)+1)))
  9.         abort();
  10.     strcpy(r,s);
  11.     r[strlen(s)] = '\0';
  12.     return r;
  13. }
  14.