archivers/zip.c
changeset 39 bc29e1ee7ef6
parent 37 768c8484b0cd
child 41 ff60d39d0862
equal deleted inserted replaced
38:feb16343f44c 39:bc29e1ee7ef6
   160             if (strcmp(buf, d) != 0)
   160             if (strcmp(buf, d) != 0)
   161                 continue; /* not for this dir; skip it. */
   161                 continue; /* not for this dir; skip it. */
   162         } /* else */
   162         } /* else */
   163 
   163 
   164         l = (LinkedStringList *) malloc(sizeof (LinkedStringList));
   164         l = (LinkedStringList *) malloc(sizeof (LinkedStringList));
   165         if (l != NULL)
   165         if (l == NULL)
   166             break;
   166             break;
   167 
   167 
   168         l->str = (char *) malloc(strlen(ptr) + 1);
   168         l->str = (char *) malloc(strlen(ptr) + 1);
   169         if (l->str == NULL)
   169         if (l->str == NULL)
   170         {
   170         {
   171             free(l);
   171             free(l);
   172             break;
   172             break;
   173         } /* if */
   173         } /* if */
       
   174 
       
   175         strcpy(l->str, ptr);
   174 
   176 
   175         if (retval == NULL)
   177         if (retval == NULL)
   176             retval = l;
   178             retval = l;
   177         else
   179         else
   178             prev->next = l;
   180             prev->next = l;