/[ofm]/ofm/fildir.c
ViewVC logotype

Diff of /ofm/fildir.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.3 by eses, Sun Jan 5 23:22:21 2003 UTC revision 1.4 by MarcusvA, Sat Jan 11 10:28:46 2003 UTC
# Line 252  DirStruct *dirSuck(char *dname) Line 252  DirStruct *dirSuck(char *dname)
252              tmp->name=NULL;              tmp->name=NULL;
253              tnsize=strlen(node->d_name)+1;              tnsize=strlen(node->d_name)+1;
254              tname=(char *)xmalloc(tnsize);              tname=(char *)xmalloc(tnsize);
255              //strcpy(tname,node->d_name);              /*strcpy(tname,node->d_name);*/
256              sprintf(tname,"%s",node->d_name);              sprintf(tname,"%s",node->d_name);
257              tmp->name=tname;              tmp->name=tname;
258              tmp->index=tindex++;              tmp->index=tindex++;
# Line 276  DirStruct *dirSuck(char *dname) Line 276  DirStruct *dirSuck(char *dname)
276                  tmp->link=S_ISLNK(stbuf.st_mode);                  tmp->link=S_ISLNK(stbuf.st_mode);
277                  tmp->size=stbuf.st_size;                  tmp->size=stbuf.st_size;
278                  tmp->mode=stbuf.st_mode;                  tmp->mode=stbuf.st_mode;
279                  //if (tmp->corrupt) tmp->mode=stbuf.st_mode&S_IFMT;                  /*if (tmp->corrupt) tmp->mode=stbuf.st_mode&S_IFMT;*/
280              }              }
281                                                    
282              if (tmp->dir) dc++;              if (tmp->dir) dc++;
# Line 322  DirStruct *dirFind(DirStruct *ds, char * Line 322  DirStruct *dirFind(DirStruct *ds, char *
322              if (strcmp(name,tmp->name)==0) return tmp;              if (strcmp(name,tmp->name)==0) return tmp;
323              tmp=tmp->next;              tmp=tmp->next;
324          }          }
325  //      fprintf(stderr,"DIRFIND: nie znaleziono %s. skonczono na %s\n",name,tmp->name);  /*      fprintf(stderr,"DIRFIND: nie znaleziono %s. skonczono na %s\n",name,tmp->name);*/
326      }      }
327      return NULL;      return NULL;
328  }  }
# Line 358  int dirProcess(DirStruct *ds, void (*fpt Line 358  int dirProcess(DirStruct *ds, void (*fpt
358                  (*fptr)(ds,DP_DIRIN);                  (*fptr)(ds,DP_DIRIN);
359                  tmp=chdir(ds->name);                  tmp=chdir(ds->name);
360                  if (tmp==0) {                  if (tmp==0) {
361  //                  fprintf(stderr,"DIRPROCESS: Entered to %s\n",ds->name);  /*                  fprintf(stderr,"DIRPROCESS: Entered to %s\n",ds->name);*/
362                      subdir=dirSuck(".");                      subdir=dirSuck(".");
363    
364                          /* we changed the directory */                          /* we changed the directory */
# Line 391  int dirProcess(DirStruct *ds, void (*fpt Line 391  int dirProcess(DirStruct *ds, void (*fpt
391              chdir("..");              chdir("..");
392              dirFree(ds);              dirFree(ds);
393              ds=dstab[last];              ds=dstab[last];
394  //          fprintf(stderr,"DIRPROCESS: Back from %s\n",ds->name);      /*          fprintf(stderr,"DIRPROCESS: Back from %s\n",ds->name);    */
395              (*fptr)(ds,DP_DIROUT);              (*fptr)(ds,DP_DIROUT);
396          }          }
397      } while ((ds->next!=NULL) && (! dp_break));      } while ((ds->next!=NULL) && (! dp_break));

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

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26