Commit 590fcd21 authored by Pavel Cisler's avatar Pavel Cisler Committed by Pavel Cisler
Browse files

Fix 1042 - "untitled folder" will not work on file systems with 8.3 names.

2000-07-04  Pavel Cisler <pavel@eazel.com>

	* src/file-manager/dfos-xfer.c: (new_folder_xfer_callback):
	Fix 1042 - "untitled folder" will not work on file systems with
	8.3 names. Added code that handles GNOME_VFS_ERROR_NAME_TOO_LONG
	and supplies a name in the 8.3 scheme instead.
parent 45e5a79f
2000-07-04 Pavel Cisler <pavel@eazel.com>
* src/file-manager/dfos-xfer.c: (new_folder_xfer_callback):
Fix 1042 - "untitled folder" will not work on file systems with
8.3 names. Added code that handles GNOME_VFS_ERROR_NAME_TOO_LONG
and supplies a name in the 8.3 scheme instead.
2000-07-04 Pavel Cisler <pavel@eazel.com> 2000-07-04 Pavel Cisler <pavel@eazel.com>
* src/file-manager/dfos-xfer-progress-dialog.c: * src/file-manager/dfos-xfer-progress-dialog.c:
......
...@@ -635,7 +635,7 @@ new_folder_xfer_callback (GnomeVFSAsyncHandle *handle, ...@@ -635,7 +635,7 @@ new_folder_xfer_callback (GnomeVFSAsyncHandle *handle,
GnomeVFSXferProgressInfo *progress_info, gpointer data) GnomeVFSXferProgressInfo *progress_info, gpointer data)
{ {
NewFolderXferState *state; NewFolderXferState *state;
char *old_name; char *temp_string;
state = (NewFolderXferState *) data; state = (NewFolderXferState *) data;
...@@ -647,12 +647,24 @@ new_folder_xfer_callback (GnomeVFSAsyncHandle *handle, ...@@ -647,12 +647,24 @@ new_folder_xfer_callback (GnomeVFSAsyncHandle *handle,
return 0; return 0;
case GNOME_VFS_XFER_PROGRESS_STATUS_DUPLICATE: case GNOME_VFS_XFER_PROGRESS_STATUS_DUPLICATE:
old_name = progress_info->duplicate_name;
progress_info->duplicate_name = g_strdup_printf ("%s %d", temp_string = progress_info->duplicate_name;
progress_info->duplicate_name,
progress_info->duplicate_count); if (progress_info->vfs_status == GNOME_VFS_ERROR_NAME_TOO_LONG) {
/* special case an 8.3 file system */
g_free (old_name); progress_info->duplicate_name = g_strndup (temp_string, 8);
progress_info->duplicate_name[8] = '\0';
g_free (temp_string);
temp_string = progress_info->duplicate_name;
progress_info->duplicate_name = g_strdup_printf ("%s.%d",
progress_info->duplicate_name,
progress_info->duplicate_count);
} else {
progress_info->duplicate_name = g_strdup_printf ("%s %d",
progress_info->duplicate_name,
progress_info->duplicate_count);
}
g_free (temp_string);
return GNOME_VFS_XFER_ERROR_ACTION_SKIP; return GNOME_VFS_XFER_ERROR_ACTION_SKIP;
default: default:
......
...@@ -635,7 +635,7 @@ new_folder_xfer_callback (GnomeVFSAsyncHandle *handle, ...@@ -635,7 +635,7 @@ new_folder_xfer_callback (GnomeVFSAsyncHandle *handle,
GnomeVFSXferProgressInfo *progress_info, gpointer data) GnomeVFSXferProgressInfo *progress_info, gpointer data)
{ {
NewFolderXferState *state; NewFolderXferState *state;
char *old_name; char *temp_string;
state = (NewFolderXferState *) data; state = (NewFolderXferState *) data;
...@@ -647,12 +647,24 @@ new_folder_xfer_callback (GnomeVFSAsyncHandle *handle, ...@@ -647,12 +647,24 @@ new_folder_xfer_callback (GnomeVFSAsyncHandle *handle,
return 0; return 0;
case GNOME_VFS_XFER_PROGRESS_STATUS_DUPLICATE: case GNOME_VFS_XFER_PROGRESS_STATUS_DUPLICATE:
old_name = progress_info->duplicate_name;
progress_info->duplicate_name = g_strdup_printf ("%s %d", temp_string = progress_info->duplicate_name;
progress_info->duplicate_name,
progress_info->duplicate_count); if (progress_info->vfs_status == GNOME_VFS_ERROR_NAME_TOO_LONG) {
/* special case an 8.3 file system */
g_free (old_name); progress_info->duplicate_name = g_strndup (temp_string, 8);
progress_info->duplicate_name[8] = '\0';
g_free (temp_string);
temp_string = progress_info->duplicate_name;
progress_info->duplicate_name = g_strdup_printf ("%s.%d",
progress_info->duplicate_name,
progress_info->duplicate_count);
} else {
progress_info->duplicate_name = g_strdup_printf ("%s %d",
progress_info->duplicate_name,
progress_info->duplicate_count);
}
g_free (temp_string);
return GNOME_VFS_XFER_ERROR_ACTION_SKIP; return GNOME_VFS_XFER_ERROR_ACTION_SKIP;
default: default:
......
...@@ -635,7 +635,7 @@ new_folder_xfer_callback (GnomeVFSAsyncHandle *handle, ...@@ -635,7 +635,7 @@ new_folder_xfer_callback (GnomeVFSAsyncHandle *handle,
GnomeVFSXferProgressInfo *progress_info, gpointer data) GnomeVFSXferProgressInfo *progress_info, gpointer data)
{ {
NewFolderXferState *state; NewFolderXferState *state;
char *old_name; char *temp_string;
state = (NewFolderXferState *) data; state = (NewFolderXferState *) data;
...@@ -647,12 +647,24 @@ new_folder_xfer_callback (GnomeVFSAsyncHandle *handle, ...@@ -647,12 +647,24 @@ new_folder_xfer_callback (GnomeVFSAsyncHandle *handle,
return 0; return 0;
case GNOME_VFS_XFER_PROGRESS_STATUS_DUPLICATE: case GNOME_VFS_XFER_PROGRESS_STATUS_DUPLICATE:
old_name = progress_info->duplicate_name;
progress_info->duplicate_name = g_strdup_printf ("%s %d", temp_string = progress_info->duplicate_name;
progress_info->duplicate_name,
progress_info->duplicate_count); if (progress_info->vfs_status == GNOME_VFS_ERROR_NAME_TOO_LONG) {
/* special case an 8.3 file system */
g_free (old_name); progress_info->duplicate_name = g_strndup (temp_string, 8);
progress_info->duplicate_name[8] = '\0';
g_free (temp_string);
temp_string = progress_info->duplicate_name;
progress_info->duplicate_name = g_strdup_printf ("%s.%d",
progress_info->duplicate_name,
progress_info->duplicate_count);
} else {
progress_info->duplicate_name = g_strdup_printf ("%s %d",
progress_info->duplicate_name,
progress_info->duplicate_count);
}
g_free (temp_string);
return GNOME_VFS_XFER_ERROR_ACTION_SKIP; return GNOME_VFS_XFER_ERROR_ACTION_SKIP;
default: default:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment