From 7bf43eb589f738b7bdb3b4837bc0dde304046a2d Mon Sep 17 00:00:00 2001 From: Alexander Shpilkin Date: Mon, 17 Sep 2012 15:52:47 +0400 Subject: Add support for glob -directory Implement support for the -directory option to the [glob] command. The -tails option is accepted for Tcl compatibility, but ignored; the command always behaves as if -tails were given. --- jim-file.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'jim-file.c') diff --git a/jim-file.c b/jim-file.c index 8214437..6b834a2 100644 --- a/jim-file.c +++ b/jim-file.c @@ -199,7 +199,9 @@ static int file_cmd_dirname(Jim_Interp *interp, int argc, Jim_Obj *const *argv) const char *path = Jim_String(argv[0]); const char *p = strrchr(path, '/'); - if (!p) { + if (!p && path[0] == '.' && path[1] == '.' && path[2] == '\0') { + Jim_SetResultString(interp, "..", -1); + } else if (!p) { Jim_SetResultString(interp, ".", -1); } else if (p == path) { -- cgit v1.1