Tcl Source Code

Check-in [59d8363bd7]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:[Bug 3537605]: Make [encoding dirs ? ?] report the right error message.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | core-8-5-branch
Files: files | file ages | folders
SHA1: 59d8363bd7baa8a5193d2b0db9382b6058adb24f
User & Date: dkf 2012-06-25 12:54:29
Context
2012-06-25
15:19
3024359 Make sure that the per-thread cache of the list of file systems currently registered is only... check-in: 575001f433 user: dgp tags: core-8-5-branch
14:43
Simplify bug fix so that active claims on the FilesystemRecord list of a thread prevent any overwrit... Closed-Leaf check-in: 37c6c2a2fc user: dgp tags: bug-3024359
12:57
[Bug 3537605]: Make [encoding dirs ? ?] report the right error message. check-in: 0d03fa5c04 user: dkf tags: trunk
12:54
[Bug 3537605]: Make [encoding dirs ? ?] report the right error message. check-in: 59d8363bd7 user: dkf tags: core-8-5-branch
07:54
[Patch #1536227]: Cygwin network pathname support check-in: 299f53aadb user: jan.nijtmans tags: core-8-5-branch
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to ChangeLog.






1
2
3
4
5
6
7





2012-06-25  Jan Nijtmans  <[email protected]>

	* generic/tclfileName.c: [Patch #1536227]: Cygwin network pathname
	* tests/fileName.test:   support

2012-06-23  Jan Nijtmans  <[email protected]>

>
>
>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
2012-06-25  Donal K. Fellows  <[email protected]>

	* generic/tclCmdAH.c (EncodingDirsObjCmd): [Bug 3537605]: Do the right
	thing when reporting errors with the number of arguments.

2012-06-25  Jan Nijtmans  <[email protected]>

	* generic/tclfileName.c: [Patch #1536227]: Cygwin network pathname
	* tests/fileName.test:   support

2012-06-23  Jan Nijtmans  <[email protected]>

Changes to generic/tclCmdAH.c.

501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
	    Tcl_DStringFree(&ds);
	}

	Tcl_FreeEncoding(encoding);
	break;
    }
    case ENC_DIRS:
	return EncodingDirsObjCmd(dummy, interp, objc-1, objv+1);
    case ENC_NAMES:
	if (objc > 2) {
	    Tcl_WrongNumArgs(interp, 2, objv, NULL);
	    return TCL_ERROR;
	}
	Tcl_GetEncodingNames(interp);
	break;







|







501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
	    Tcl_DStringFree(&ds);
	}

	Tcl_FreeEncoding(encoding);
	break;
    }
    case ENC_DIRS:
	return EncodingDirsObjCmd(dummy, interp, objc, objv);
    case ENC_NAMES:
	if (objc > 2) {
	    Tcl_WrongNumArgs(interp, 2, objv, NULL);
	    return TCL_ERROR;
	}
	Tcl_GetEncodingNames(interp);
	break;
548
549
550
551
552
553
554


555
556
557
558
559
560
561
562


563
564
565
566
567
568
569
570
571
572
573
574
575
int
EncodingDirsObjCmd(
    ClientData dummy,		/* Not used. */
    Tcl_Interp *interp,		/* Current interpreter. */
    int objc,			/* Number of arguments. */
    Tcl_Obj *const objv[])	/* Argument objects. */
{


    if (objc > 2) {
	Tcl_WrongNumArgs(interp, 1, objv, "?dirList?");
	return TCL_ERROR;
    }
    if (objc == 1) {
	Tcl_SetObjResult(interp, Tcl_GetEncodingSearchPath());
	return TCL_OK;
    }


    if (Tcl_SetEncodingSearchPath(objv[1]) == TCL_ERROR) {
	Tcl_AppendResult(interp, "expected directory list but got \"",
		TclGetString(objv[1]), "\"", NULL);
	return TCL_ERROR;
    }
    Tcl_SetObjResult(interp, objv[1]);
    return TCL_OK;
}

/*
 *----------------------------------------------------------------------
 *
 * Tcl_ErrorObjCmd --







>
>
|
|


|



>
>
|

|


|







548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
int
EncodingDirsObjCmd(
    ClientData dummy,		/* Not used. */
    Tcl_Interp *interp,		/* Current interpreter. */
    int objc,			/* Number of arguments. */
    Tcl_Obj *const objv[])	/* Argument objects. */
{
    Tcl_Obj *dirListObj;

    if (objc > 3) {
	Tcl_WrongNumArgs(interp, 2, objv, "?dirList?");
	return TCL_ERROR;
    }
    if (objc == 2) {
	Tcl_SetObjResult(interp, Tcl_GetEncodingSearchPath());
	return TCL_OK;
    }

    dirListObj = objv[2];
    if (Tcl_SetEncodingSearchPath(dirListObj) == TCL_ERROR) {
	Tcl_AppendResult(interp, "expected directory list but got \"",
		TclGetString(dirListObj), "\"", NULL);
	return TCL_ERROR;
    }
    Tcl_SetObjResult(interp, dirListObj);
    return TCL_OK;
}

/*
 *----------------------------------------------------------------------
 *
 * Tcl_ErrorObjCmd --

Changes to tests/encoding.test.

582
583
584
585
586
587
588








589
590
591
592
593
594
595
} -result slappy

file delete {*}[glob -directory [temporaryDirectory] *.chars *.tcltestout]
# ===> Cut here <===

# EscapeFreeProc, GetTableEncoding, unilen
# are fully tested by the rest of this file








}
runtests

}

# cleanup
namespace delete ::tcl::test::encoding







>
>
>
>
>
>
>
>







582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
} -result slappy

file delete {*}[glob -directory [temporaryDirectory] *.chars *.tcltestout]
# ===> Cut here <===

# EscapeFreeProc, GetTableEncoding, unilen
# are fully tested by the rest of this file

test encoding-27.1 {encoding dirs basic behavior} -returnCodes error -body {
    encoding dirs ? ?
} -result {wrong # args: should be "encoding dirs ?dirList?"}
test encoding-27.2 {encoding dirs basic behavior} -returnCodes error -body {
    encoding dirs "\{not a list"
} -result "expected directory list but got \"\{not a list\""

}
runtests

}

# cleanup
namespace delete ::tcl::test::encoding