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

Diff for /src/usr.bin/spell/spellprog.c between version 1.1 and 1.2

version 1.1, 2002/03/01 22:01:11 version 1.2, 2002/03/02 16:20:33
Line 122 
Line 122 
 int      VCe(char *, char *, char *, int);  int      VCe(char *, char *, char *, int);
 char    *lookuppref(char **, char *);  char    *lookuppref(char **, char *);
 char    *skipv(char *);  char    *skipv(char *);
   char    *estrdup(const char *);
 void     ise(void);  void     ise(void);
 void     print_word(FILE *);  void     print_word(FILE *);
 void     ztos(char *);  void     ztos(char *);
Line 131 
Line 132 
 int      look(unsigned char *, unsigned char *, unsigned char *);  int      look(unsigned char *, unsigned char *, unsigned char *);
   
 struct suftab {  struct suftab {
         char *suf;      /* XXX - needs to be writable for ise() */          char *suf;
         int (*p1)();    /* XXX - variable args */          int (*p1)();    /* XXX - variable args */
         int n1;          int n1;
         char *d1;          char *d1;
Line 317 
Line 318 
         else if ((found = fopen(outfile, "w")) == NULL)          else if ((found = fopen(outfile, "w")) == NULL)
                 err(1, "cannot open %s", outfile);                  err(1, "cannot open %s", outfile);
   
         /* XXX - this fprintf is for loop abuse */  
         for (;; print_word(file)) {          for (;; print_word(file)) {
                 affix[0] = '\0';                  affix[0] = '\0';
                 file = found;                  file = found;
Line 742 
Line 742 
 void  void
 ise(void)  ise(void)
 {  {
         struct suftab *p;          struct suftab *tab;
   
         for (p = suftab; p->suf; p++) {          for (tab = suftab; tab->suf; tab++) {
                 ztos(p->suf);                  /* Assume that suffix will contain 'z' if a1 or d1 do */
                 ztos(p->d1);                  if (strchr(tab->suf, 'z')) {
                 ztos(p->a1);                          tab->suf = estrdup(tab->suf);
                           ztos(tab->suf);
                           if (strchr(tab->d1, 'z')) {
                                   tab->d1 = estrdup(tab->d1);
                                   ztos(tab->d1);
                           }
                           if (strchr(tab->a1, 'z')) {
                                   tab->a1 = estrdup(tab->a1);
                                   ztos(tab->a1);
                           }
                   }
         }          }
 }  }
   
Line 758 
Line 768 
         for (; *s; s++)          for (; *s; s++)
                 if (*s == 'z')                  if (*s == 'z')
                         *s = 's';                          *s = 's';
   }
   
   char *
   estrdup(const char *s)
   {
           char *d;
   
           if ((d = strdup(s)) == NULL)
                   err(1, "strdup");
           return(d);
 }  }
   
 /*  /*

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2