Ticket #12622: macports-ftscompare.patch

File macports-ftscompare.patch, 927 bytes (added by afb@…, 17 years ago)

macports-ftscompare.patch

  • src/pextlib1.0/fs-traverse.c

     
    127127    return rval;
    128128}
    129129
     130static int
     131do_compare(const FTSENT **a, const FTSENT **b)
     132{
     133    if ((*a)->fts_info == FTS_ERR || (*b)->fts_info == FTS_ERR)
     134        return 0;
     135
     136    return strcmp((*a)->fts_name, (*b)->fts_name);
     137}
     138
    130139static int
    131140do_traverse(Tcl_Interp *interp, int flags, char * CONST *targets, Tcl_Obj *varname, Tcl_Obj *body)
    132141{
     
    134143    FTS *root_fts;
    135144    FTSENT *ent;
    136145   
    137     root_fts = fts_open(targets, FTS_PHYSICAL /*| FTS_COMFOLLOW */| FTS_NOCHDIR | FTS_XDEV, NULL);
     146    root_fts = fts_open(targets, FTS_PHYSICAL /*| FTS_COMFOLLOW */| FTS_NOCHDIR | FTS_XDEV, &do_compare);
    138147   
    139148    while ((ent = fts_read(root_fts)) != NULL) {
    140149        switch (ent->fts_info) {