Subversion Repositories SvarDOS

Rev

Rev 2062 | Rev 2064 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2062 Rev 2063
Line 589... Line 589...
589
 * and path is valid.
589
 * and path is valid.
590
 */
590
 */
591
static long hasSubdirectories(char *path, DIRDATA *ddata) {
591
static long hasSubdirectories(char *path, DIRDATA *ddata) {
592
  struct find_t findData;
592
  struct find_t findData;
593
  char buffer[PATH_MAX + 4];
593
  char buffer[PATH_MAX + 4];
594
  int hasSubdirs = 0;
594
  unsigned short hasSubdirs = 0;
595
 
595
 
596
  /* get the handle to start with (using wildcard spec) */
596
  /* get the handle to start with (using wildcard spec) */
597
  strcpy(buffer, path);
597
  strcpy(buffer, path);
598
  strcat(buffer, "*.*");
598
  strcat(buffer, "*.*");
599
 
599
 
Line 602... Line 602...
602
    return(-1);
602
    return(-1);
603
  }
603
  }
604
 
604
 
605
  /*  cycle through entries counting directories found until no more entries */
605
  /*  cycle through entries counting directories found until no more entries */
606
  do {
606
  do {
607
    if (((findData.attrib & _A_SUBDIR) != 0) &&
607
    if ((findData.attrib & _A_SUBDIR) == 0) continue; /* not a DIR */
-
 
608
      /* filter out system and hidden files, unless dspAll is on */
-
 
609
    if (dspAll == 0) {
608
        ((findData.attrib &
610
      if (findData.attrib & _A_HIDDEN) continue;
609
         (_A_HIDDEN | _A_SYSTEM)) == 0 || dspAll) ) {
611
      if (findData.attrib & _A_SYSTEM) continue;
-
 
612
    }
610
      if (findData.name[0] != '.') { /* ignore '.' and '..' */
613
    if (findData.name[0] != '.') { /* ignore '.' and '..' */
611
        hasSubdirs++;      /* subdir of initial path found, so increment counter */
614
      hasSubdirs++;      /* subdir of initial path found, so increment counter */
612
      }
-
 
613
    }
615
    }
614
  } while(_dos_findnext(&findData) == 0);
616
  } while(_dos_findnext(&findData) == 0);
615
 
617
 
616
  /* prevent resource leaks, close the handle. */
618
  /* prevent resource leaks, close the handle. */
617
  _dos_findclose(&findData);
619
  _dos_findclose(&findData);