diff options
author | Alexander Shpilkin <ashpilkin@gmail.com> | 2012-09-17 15:52:47 +0400 |
---|---|---|
committer | Steve Bennett <steveb@workware.net.au> | 2012-09-20 08:47:26 +1000 |
commit | 7bf43eb589f738b7bdb3b4837bc0dde304046a2d (patch) | |
tree | b412fd58f67f0fa8473b447698c670e14d629b4f /jim-file.c | |
parent | 33e51c4b9ef4de3398a57da99eb6f5fbcd1d85e4 (diff) | |
download | jimtcl-7bf43eb589f738b7bdb3b4837bc0dde304046a2d.zip jimtcl-7bf43eb589f738b7bdb3b4837bc0dde304046a2d.tar.gz jimtcl-7bf43eb589f738b7bdb3b4837bc0dde304046a2d.tar.bz2 |
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.
Diffstat (limited to 'jim-file.c')
-rw-r--r-- | jim-file.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -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) { |