file name in the text box.
+2005-01-15 Steven Tamm <steventamm@mac.com>
+
+ * macfns.c (Fx_file_dialog): Save As dialog includes only the
+ file name in the text box.
+
2005-01-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
* macfns.c (x_set_foreground_color, x_set_background_color): Sync
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;
}