~ubuntu-branches/ubuntu/raring/tcl8.5/raring

« back to all changes in this revision

Viewing changes to generic/tclFileName.c

  • Committer: Bazaar Package Importer
  • Author(s): Sergei Golovan
  • Date: 2009-11-22 14:23:53 UTC
  • mfrom: (10.1.1 sid)
  • Revision ID: james.westby@ubuntu.com-20091122142353-a0awlv6cays5y50f
Tags: 8.5.8-2
Fixed building on MIPS architectures. The upstream changes in 8.5.8
include changing FPU settings which isn't possible in Debian GNU/Linux
(and isn't required also).

Show diffs side-by-side

added added

removed removed

Lines of Context:
10
10
 * See the file "license.terms" for information on usage and redistribution of
11
11
 * this file, and for a DISCLAIMER OF ALL WARRANTIES.
12
12
 *
13
 
 * RCS: @(#) $Id: tclFileName.c,v 1.86.2.2 2008/12/03 07:03:13 dgp Exp $
 
13
 * RCS: @(#) $Id: tclFileName.c,v 1.86.2.4 2009/08/21 19:03:20 dgp Exp $
14
14
 */
15
15
 
16
16
#include "tclInt.h"
2350
2350
                pattern, &dirOnly);
2351
2351
        *p = save;
2352
2352
        if (result == TCL_OK) {
2353
 
            int subdirc, i;
 
2353
            int subdirc, i, repair = -1;
2354
2354
            Tcl_Obj **subdirv;
2355
2355
 
2356
2356
            result = Tcl_ListObjGetElements(interp, subdirsPtr,
2357
2357
                    &subdirc, &subdirv);
2358
2358
            for (i=0; result==TCL_OK && i<subdirc; i++) {
 
2359
                Tcl_Obj *copy = NULL;
 
2360
 
 
2361
                if (pathPtr == NULL && Tcl_GetString(subdirv[i])[0] == '~') {
 
2362
                    Tcl_ListObjLength(NULL, matchesObj, &repair);
 
2363
                    copy = subdirv[i];
 
2364
                    subdirv[i] = Tcl_NewStringObj("./", 2);
 
2365
                    Tcl_AppendObjToObj(subdirv[i], copy);
 
2366
                    Tcl_IncrRefCount(subdirv[i]);
 
2367
                }
2359
2368
                result = DoGlob(interp, matchesObj, separators, subdirv[i],
2360
2369
                        1, p+1, types);
 
2370
                if (copy) {
 
2371
                    int end;
 
2372
 
 
2373
                    Tcl_DecrRefCount(subdirv[i]);
 
2374
                    subdirv[i] = copy;
 
2375
                    Tcl_ListObjLength(NULL, matchesObj, &end);
 
2376
                    while (repair < end) {
 
2377
                        const char *bytes;
 
2378
                        int numBytes;
 
2379
                        Tcl_Obj *fixme, *newObj;
 
2380
                        Tcl_ListObjIndex(NULL, matchesObj, repair, &fixme);
 
2381
                        bytes = Tcl_GetStringFromObj(fixme, &numBytes);
 
2382
                        newObj = Tcl_NewStringObj(bytes+2, numBytes-2);
 
2383
                        Tcl_ListObjReplace(NULL, matchesObj, repair, 1,
 
2384
                                1, &newObj);
 
2385
                        repair++;
 
2386
                    }
 
2387
                    repair = -1;
 
2388
                }
2361
2389
            }
2362
2390
        }
2363
2391
        TclDecrRefCount(subdirsPtr);