From a3e470a520e59549b32c105f2aa0234c30eac772 Mon Sep 17 00:00:00 2001 From: dgp Date: Mon, 29 Sep 2008 16:03:27 +0000 Subject: TIP #323 IMPLEMENTATION (partial) * doc/glob.n: Revise [glob] to accept zero patterns. * generic/tclFileName.c: * tests fileName.test: --- ChangeLog | 4 ++++ doc/glob.n | 4 ++-- generic/tclFileName.c | 6 +----- tests/fileName.test | 12 ++++++------ 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/ChangeLog b/ChangeLog index 03715da..ee5e0bd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,10 @@ TIP #323 IMPLEMENTATION (partial) + * doc/glob.n: Revise [glob] to accept zero patterns. + * generic/tclFileName.c: + * tests fileName.test: + * doc/linsert.n: Revise [linsert] to accept zero elements. * generic/tclCmdIL.c: * tests/linsert.test: diff --git a/doc/glob.n b/doc/glob.n index d2751d3..a7cf7ad 100644 --- a/doc/glob.n +++ b/doc/glob.n @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: glob.n,v 1.22 2007/12/13 15:22:32 dgp Exp $ +'\" RCS: @(#) $Id: glob.n,v 1.23 2008/09/29 16:03:29 dgp Exp $ '\" .so man.macros .TH glob n 8.3 Tcl "Tcl Built-In Commands" @@ -14,7 +14,7 @@ .SH NAME glob \- Return names of files that match patterns .SH SYNOPSIS -\fBglob \fR?\fIswitches\fR? \fIpattern \fR?\fIpattern ...\fR? +\fBglob \fR?\fIswitches\fR? ?\fIpattern ...\fR? .BE .SH DESCRIPTION diff --git a/generic/tclFileName.c b/generic/tclFileName.c index 9ff6c07..0c29459 100644 --- a/generic/tclFileName.c +++ b/generic/tclFileName.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclFileName.c,v 1.92 2008/09/27 19:47:29 dkf Exp $ + * RCS: @(#) $Id: tclFileName.c,v 1.93 2008/09/29 16:03:30 dgp Exp $ */ #include "tclInt.h" @@ -1309,10 +1309,6 @@ Tcl_GlobObjCmd( } endOfForLoop: - if (objc - i < 1) { - Tcl_WrongNumArgs(interp, 1, objv, "?-switch ...? name ?name ...?"); - return TCL_ERROR; - } if ((globFlags & TCL_GLOBMODE_TAILS) && (pathOrDir == NULL)) { Tcl_AppendResult(interp, "\"-tails\" must be used with either " diff --git a/tests/fileName.test b/tests/fileName.test index 86a1b23..1d1f3ce 100644 --- a/tests/fileName.test +++ b/tests/fileName.test @@ -10,7 +10,7 @@ # See the file "license.terms" for information on usage and redistribution of # this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: fileName.test,v 1.56 2008/08/14 13:09:50 dgp Exp $ +# RCS: @(#) $Id: fileName.test,v 1.57 2008/09/29 16:03:30 dgp Exp $ if {[lsearch [namespace children] ::tcltest] == -1} { package require tcltest 2 @@ -697,16 +697,16 @@ test filename-10.24 {Tcl_TranslateFileName} -body { test filename-11.1 {Tcl_GlobCmd} -returnCodes error -body { glob -} -result {wrong # args: should be "glob ?-switch ...? name ?name ...?"} +} -result {no files matched glob patterns ""} test filename-11.2 {Tcl_GlobCmd} -returnCodes error -body { glob -gorp } -result {bad option "-gorp": must be -directory, -join, -nocomplain, -path, -tails, -types, or --} -test filename-11.3 {Tcl_GlobCmd} -returnCodes error -body { +test filename-11.3 {Tcl_GlobCmd} -body { glob -nocomplai -} -result {wrong # args: should be "glob ?-switch ...? name ?name ...?"} -test filename-11.4 {Tcl_GlobCmd} -returnCodes error -body { +} -result {} +test filename-11.4 {Tcl_GlobCmd} -body { glob -nocomplain -} -result {wrong # args: should be "glob ?-switch ...? name ?name ...?"} +} -result {} test filename-11.5 {Tcl_GlobCmd} -returnCodes error -body { glob -nocomplain * ~xyqrszzz } -result {user "xyqrszzz" doesn't exist} -- cgit v0.12