From: Steven Tamm Date: Sun, 16 Jan 2005 00:17:25 +0000 (+0000) Subject: * macfns.c (Fx_file_dialog): Save As dialog includes only the X-Git-Tag: ttn-vms-21-2-B4~2726 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=42afbcda13137806a3fd51c466526e29026947b9;p=emacs.git * macfns.c (Fx_file_dialog): Save As dialog includes only the file name in the text box. --- diff --git a/src/ChangeLog b/src/ChangeLog index 07beb35f685..a8dd700f7d5 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2005-01-15 Steven Tamm + + * macfns.c (Fx_file_dialog): Save As dialog includes only the + file name in the text box. + 2005-01-15 YAMAMOTO Mitsuharu * macfns.c (x_set_foreground_color, x_set_background_color): Sync diff --git a/src/macfns.c b/src/macfns.c index 2b223dfdfb5..33da9091575 100644 --- a/src/macfns.c +++ b/src/macfns.c @@ -4356,9 +4356,12 @@ If ONLY-DIR-P is non-nil, the user can only select directories. */) if (!NILP(default_filename)) { - saveName = - cfstring_create_with_utf8_cstring (SDATA (ENCODE_UTF_8 - (default_filename))); + Lisp_Object utf8 = ENCODE_UTF_8 (default_filename); + char *begPtr = SDATA(utf8); + char *filePtr = begPtr + SBYTES(utf8); + while (filePtr != begPtr && !IS_DIRECTORY_SEP(filePtr[-1])) + filePtr--; + saveName = cfstring_create_with_utf8_cstring (filePtr); options.saveFileName = saveName; options.optionFlags |= kNavSelectDefaultLocation; }