Diff
Not logged in

Differences From Artifact [44df3641d1]:

To Artifact [c4170af21d]:


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/* 
 * tclUnixFile.c --
 *
 *      This file contains wrappers around UNIX file handling functions.
 *      These wrappers mask differences between Windows and UNIX.
 *
 * Copyright (c) 1995-1998 Sun Microsystems, Inc.
 *
 * See the file "license.terms" for information on usage and redistribution
 * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
 *
 * RCS: @(#) $Id: tclUnixFile.c,v 1.15 2002/01/25 20:40:56 dgp Exp $
 */

#include "tclInt.h"
#include "tclPort.h"


/*











|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/* 
 * tclUnixFile.c --
 *
 *      This file contains wrappers around UNIX file handling functions.
 *      These wrappers mask differences between Windows and UNIX.
 *
 * Copyright (c) 1995-1998 Sun Microsystems, Inc.
 *
 * See the file "license.terms" for information on usage and redistribution
 * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
 *
 * RCS: @(#) $Id: tclUnixFile.c,v 1.16 2002/02/08 02:52:54 dgp Exp $
 */

#include "tclInt.h"
#include "tclPort.h"


/*
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245

    if (baseLength == 0) {
	dirName = ".";
    } else {
	dirName = Tcl_DStringValue(&dsOrig);
	/* Make sure we have a trailing directory delimiter */
	if (dirName[baseLength-1] != '/') {
	    Tcl_DStringAppend(&dsOrig, "/", 1);
	    dirName = Tcl_DStringValue(&dsOrig);
	    baseLength++;
	}
    }

    /*
     * Check to see if the pattern needs to compare with hidden files.
     */







|
<







230
231
232
233
234
235
236
237

238
239
240
241
242
243
244

    if (baseLength == 0) {
	dirName = ".";
    } else {
	dirName = Tcl_DStringValue(&dsOrig);
	/* Make sure we have a trailing directory delimiter */
	if (dirName[baseLength-1] != '/') {
	    dirName = Tcl_DStringAppend(&dsOrig, "/", 1);

	    baseLength++;
	}
    }

    /*
     * Check to see if the pattern needs to compare with hidden files.
     */
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
	    Tcl_DStringSetLength(&dsOrig, baseLength);
	    Tcl_DStringAppend(&dsOrig, utf, -1);
	    fname = Tcl_DStringValue(&dsOrig);
	    if (types != NULL) {
		struct stat buf;
		char *nativeEntry;
		Tcl_DStringSetLength(&ds, nativeDirLen);
		Tcl_DStringAppend(&ds, entryPtr->d_name, -1);
		nativeEntry = Tcl_DStringValue(&ds);
		/* 
		 * The native name of the file is in entryPtr->d_name.
		 * We can use this below.
		 */
		
		if (types->perm != 0) {
		    if (stat(nativeEntry, &buf) != 0) {







|
<







328
329
330
331
332
333
334
335

336
337
338
339
340
341
342
	    Tcl_DStringSetLength(&dsOrig, baseLength);
	    Tcl_DStringAppend(&dsOrig, utf, -1);
	    fname = Tcl_DStringValue(&dsOrig);
	    if (types != NULL) {
		struct stat buf;
		char *nativeEntry;
		Tcl_DStringSetLength(&ds, nativeDirLen);
		nativeEntry = Tcl_DStringAppend(&ds, entryPtr->d_name, -1);

		/* 
		 * The native name of the file is in entryPtr->d_name.
		 * We can use this below.
		 */
		
		if (types->perm != 0) {
		    if (stat(nativeEntry, &buf) != 0) {