# HG changeset patch # User Steven Tamm # Date 1105834645 0 # Node ID bf1c907c5570628f3e99e256c37d9e7ef8f9fbd9 # Parent 011a0c55c1f26ea107d47a76be01d1c23f87e721 * macfns.c (Fx_file_dialog): Save As dialog includes only the file name in the text box. diff -r 011a0c55c1f2 -r bf1c907c5570 src/ChangeLog --- a/src/ChangeLog Sun Jan 16 00:10:18 2005 +0000 +++ b/src/ChangeLog Sun Jan 16 00:17:25 2005 +0000 @@ -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 -r 011a0c55c1f2 -r bf1c907c5570 src/macfns.c --- a/src/macfns.c Sun Jan 16 00:10:18 2005 +0000 +++ b/src/macfns.c Sun Jan 16 00:17:25 2005 +0000 @@ -4356,9 +4356,12 @@ 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; }