[BACK]Return to string.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / window

Diff for /src/usr.bin/window/Attic/string.c between version 1.4 and 1.5

version 1.4, 1998/04/26 22:49:06 version 1.5, 2001/11/19 19:02:18
Line 51 
Line 51 
   
 char *  char *
 str_cpy(s)  str_cpy(s)
 register char *s;  char *s;
 {  {
         char *str;          char *str;
         register char *p;          char *p;
   
         str = p = str_alloc(strlen(s) + 1);          str = p = str_alloc(strlen(s) + 1);
         if (p == 0)          if (p == 0)
Line 66 
Line 66 
   
 char *  char *
 str_ncpy(s, n)  str_ncpy(s, n)
 register char *s;  char *s;
 register n;  int n;
 {  {
         int l = strlen(s);          int l = strlen(s);
         char *str;          char *str;
         register char *p;          char *p;
   
         if (n > l)          if (n > l)
                 n = l;                  n = l;
Line 99 
Line 99 
 char *s1, *s2;  char *s1, *s2;
 {  {
         char *str;          char *str;
         register char *p, *q;          char *p, *q;
   
         str = p = str_alloc(strlen(s1) + strlen(s2) + 1);          str = p = str_alloc(strlen(s1) + strlen(s2) + 1);
         if (p == 0)          if (p == 0)
Line 116 
Line 116 
  * s can be a prefix of p with at least min characters.   * s can be a prefix of p with at least min characters.
  */   */
 str_match(s, p, min)  str_match(s, p, min)
 register char *s, *p;  char *s, *p;
 register min;  int min;
 {  {
         for (; *s && *p && *s == *p; s++, p++, min--)          for (; *s && *p && *s == *p; s++, p++, min--)
                 ;                  ;
Line 129 
Line 129 
 str_alloc(l)  str_alloc(l)
 int l;  int l;
 {  {
         register struct string *s;          struct string *s;
   
         s = (struct string *) malloc(l + str_offset);          s = (struct string *) malloc(l + str_offset);
         if (s == 0)          if (s == 0)
Line 146 
Line 146 
 str_free(str)  str_free(str)
 char *str;  char *str;
 {  {
         register struct string *s;          struct string *s;
   
         for (s = str_head.s_forw; s != &str_head && s->s_data != str;          for (s = str_head.s_forw; s != &str_head && s->s_data != str;
              s = s->s_forw)               s = s->s_forw)

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5