Changeset 3050
- Timestamp:
- 03/09/03 05:55:38 (6 years ago)
- Files:
-
- work/cvs2svn/src/mw32fns.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
work/cvs2svn/src/mw32fns.c
r3029 r3050 8932 8932 int count = specpdl_ptr - specpdl; 8933 8933 struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5; 8934 char filename[MAX_PATH + 1];8935 char init_dir[MAX_PATH + 1];8934 LPTSTR init_dir; 8935 TCHAR filename[MAX_PATH + 1]; 8936 8936 int use_dialog_p = 1; 8937 8937 … … 8943 8943 directory and using "*" as pattern. */ 8944 8944 dir = Fexpand_file_name (dir, Qnil); 8945 strncpy (init_dir, XSTRING (dir)->data, MAX_PATH); 8946 init_dir[MAX_PATH] = '\0'; 8947 unixtodos_filename (init_dir); 8945 init_dir = mw32_encode_lispy_string (Vw32_system_coding_system, 8946 Funix_to_dos_filename (dir), NULL); 8948 8947 8949 8948 if (STRINGP (default_filename)) 8950 8949 { 8951 char *file_name_only; 8952 char *full_path_name = XSTRING (ENCODE_FILE (default_filename))->data; 8953 8954 unixtodos_filename (full_path_name); 8955 8956 file_name_only = strrchr (full_path_name, '\\'); 8957 if (!file_name_only) 8958 file_name_only = full_path_name; 8950 file = Ffile_name_nondirectory (Funix_to_dos_filename (default_filename)); 8951 if (LISPY_STRING_BYTES(file) > 0) 8952 { 8953 int size; 8954 LPTSTR filename_tmp; 8955 8956 filename_tmp = mw32_encode_lispy_string (Vw32_system_coding_system, file, &size); 8957 memcpy (filename, filename_tmp, size); 8958 filename[size / sizeof(filename[0])] = '\0'; 8959 } 8959 8960 else 8960 { 8961 file_name_only++; 8962 8963 /* If default_file_name is a directory, don't use the open 8964 file dialog, as it does not support selecting 8965 directories. */ 8966 if (!(*file_name_only)) 8967 use_dialog_p = 0; 8968 } 8969 8970 strncpy (filename, file_name_only, MAX_PATH); 8971 filename[MAX_PATH] = '\0'; 8961 { 8962 /* If default_file_name is a directory, don't use the open 8963 file dialog, as it does not support selecting 8964 directories. */ 8965 use_dialog_p = 0; 8966 } 8972 8967 } 8973 8968 else … … 8986 8981 file_details.hwndOwner = FRAME_MW32_WINDOW (f); 8987 8982 file_details.lpstrFile = filename; 8988 file_details.nMaxFile = sizeof (filename) ;8983 file_details.nMaxFile = sizeof (filename) / sizeof (filename[0]); 8989 8984 file_details.lpstrInitialDir = init_dir; 8990 file_details.lpstrTitle = XSTRING (prompt)->data; 8985 file_details.lpstrTitle = mw32_encode_lispy_string (Vw32_system_coding_system, 8986 prompt, NULL); 8991 8987 file_details.Flags = OFN_HIDEREADONLY | OFN_NOCHANGEDIR; 8992 8988 … … 8996 8992 if (GetOpenFileName (&file_details)) 8997 8993 { 8998 dostounix_filename (filename); 8999 file = DECODE_FILE (build_string (filename)); 8994 file = mw32_decode_lispy_string (Vw32_system_coding_system, 8995 filename, 0); 8996 file = Fdos_to_unix_filename (file); 9000 8997 } 9001 8998 else 9002 file = Qnil;8999 file = Qnil; 9003 9000 9004 9001 UNBLOCK_INPUT;
