Ignore:
Timestamp:
Oct 7, 2007, 10:39:58 PM (18 years ago)
Author:
bird
Message:

some more cleanup.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kash/expand.c

    r1207 r1214  
    3333 */
    3434
    35 #ifdef HAVE_SYS_CDEFS_H
    36 #include <sys/cdefs.h>
    37 #endif
     35#if 0
    3836#ifndef lint
    39 #if 0
    4037static char sccsid[] = "@(#)expand.c    8.5 (Berkeley) 5/15/95";
    4138#else
    4239__RCSID("$NetBSD: expand.c,v 1.71 2005/06/01 15:41:19 lukem Exp $");
     40#endif /* not lint */
    4341#endif
    44 #endif /* not lint */
    4542
    4643#include <sys/types.h>
    4744#include <sys/time.h>
    48 #include <sys/stat.h>
    4945#include <errno.h>
    50 #include <dirent.h>
    51 #include <unistd.h>
    52 #include <pwd.h>
    5346#include <stdlib.h>
    5447#include <stdio.h>
    55 #ifdef __sun__
    56 #include <iso/limits_iso.h>
    57 #endif
    5848
    5949/*
     
    267257{
    268258        char c, *startp = p;
    269         struct passwd *pw;
    270259        const char *home;
    271260        int quotes = flag & (EXP_FULL | EXP_CASE);
     
    292281                        goto lose;
    293282        } else {
    294                 if ((pw = getpwnam(startp+1)) == NULL)
     283                if ((home = sh_gethomedir(psh, startp+1)) == NULL)
    295284                        goto lose;
    296                 home = pw->pw_dir;
    297285        }
    298286        if (*home == '\0')
     
    11401128        int metaflag;
    11411129        struct stat statb;
    1142         DIR *dirp;
    1143         struct dirent *dp;
     1130        shdir *dirp;
     1131        shdirent *dp;
    11441132        int atend;
    11451133        int matchdot;
     
    12151203                enddir[-1] = '\0';
    12161204        }
    1217         if ((dirp = opendir(cp)) == NULL)
     1205        if ((dirp = shfile_opendir(&psh->fdtab, cp)) == NULL)
    12181206                return;
    12191207        if (enddir != psh->expdir)
     
    12331221        if (*p == '.')
    12341222                matchdot++;
    1235         while (! int_pending() && (dp = readdir(dirp)) != NULL) {
    1236                 if (dp->d_name[0] == '.' && ! matchdot)
     1223        while (! int_pending() && (dp = shfile_readdir(dirp)) != NULL) {
     1224                if (dp->name[0] == '.' && ! matchdot)
    12371225                        continue;
    1238                 if (patmatch(psh, start, dp->d_name, 0)) {
     1226                if (patmatch(psh, start, dp->name, 0)) {
    12391227                        if (atend) {
    1240                                 scopy(dp->d_name, enddir);
     1228                                scopy(dp->name, enddir);
    12411229                                addfname(psh, psh->expdir);
    12421230                        } else {
    1243                                 for (p = enddir, cp = dp->d_name;
     1231                                for (p = enddir, cp = dp->name;
    12441232                                     (*p++ = *cp++) != '\0';)
    12451233                                        continue;
     
    12491237                }
    12501238        }
    1251         closedir(dirp);
     1239        shfile_closedir(dirp);
    12521240        if (! atend)
    12531241                endname[-1] = '/';
Note: See TracChangeset for help on using the changeset viewer.