mirror of
git://git.code.sf.net/p/cdesktopenv/code
synced 2025-02-15 04:32:24 +00:00
dtfile/FileMgr: CID 88441,89025,174801
This commit is contained in:
parent
e2162e0800
commit
141bfca04e
1 changed files with 35 additions and 25 deletions
|
@ -2414,6 +2414,7 @@ GetSessionDir(
|
||||||
char *user_session_str;
|
char *user_session_str;
|
||||||
char *toolbox_dir;
|
char *toolbox_dir;
|
||||||
char *current_dir;
|
char *current_dir;
|
||||||
|
size_t len = 0;
|
||||||
|
|
||||||
root_toolbox = (file_mgr_data->host);
|
root_toolbox = (file_mgr_data->host);
|
||||||
|
|
||||||
|
@ -2425,19 +2426,26 @@ GetSessionDir(
|
||||||
toolbox_dir = file_mgr_data->current_directory;
|
toolbox_dir = file_mgr_data->current_directory;
|
||||||
toolbox_dir += strlen(file_mgr_data->restricted_directory);
|
toolbox_dir += strlen(file_mgr_data->restricted_directory);
|
||||||
|
|
||||||
current_dir = XtMalloc(strlen(root_toolbox) +
|
len = strlen(root_toolbox) +
|
||||||
strlen(user_session_str) +
|
strlen(user_session_str) +
|
||||||
strlen(toolbox_dir) + 1);
|
strlen(toolbox_dir) + 1;
|
||||||
sprintf(current_dir, "%s%s%s", root_toolbox,
|
current_dir = XtMalloc(len);
|
||||||
user_session_str,
|
if (current_dir)
|
||||||
toolbox_dir);
|
{
|
||||||
file_mgr_data->current_directory = current_dir;
|
snprintf(current_dir, len, "%s%s%s", root_toolbox,
|
||||||
|
user_session_str,
|
||||||
|
toolbox_dir);
|
||||||
|
file_mgr_data->current_directory = current_dir;
|
||||||
|
}
|
||||||
|
|
||||||
file_mgr_data->restricted_directory = XtMalloc(strlen(root_toolbox) +
|
len = strlen(root_toolbox) + strlen(user_session_str) + 1;
|
||||||
strlen(user_session_str) +
|
file_mgr_data->restricted_directory = XtMalloc(len);
|
||||||
1);
|
if (file_mgr_data->restricted_directory)
|
||||||
sprintf(file_mgr_data->restricted_directory, "%s%s", root_toolbox,
|
{
|
||||||
user_session_str);
|
snprintf(file_mgr_data->restricted_directory, len, "%s%s",
|
||||||
|
root_toolbox,
|
||||||
|
user_session_str);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -2536,10 +2544,11 @@ BranchListToString(
|
||||||
int i;
|
int i;
|
||||||
Boolean first = True;
|
Boolean first = True;
|
||||||
char * branch_name;
|
char * branch_name;
|
||||||
|
int rv;
|
||||||
|
|
||||||
if (*value != NULL)
|
if (*value != NULL)
|
||||||
{
|
{
|
||||||
(void) write (fd, out_buf, strlen (out_buf));
|
rv = write (fd, out_buf, strlen (out_buf));
|
||||||
|
|
||||||
i = 0;
|
i = 0;
|
||||||
branch_name = (*value)[i];
|
branch_name = (*value)[i];
|
||||||
|
@ -2547,17 +2556,17 @@ BranchListToString(
|
||||||
while (branch_name != NULL)
|
while (branch_name != NULL)
|
||||||
{
|
{
|
||||||
if (!first)
|
if (!first)
|
||||||
(void) write (fd, ", ", strlen (", "));
|
rv = write (fd, ", ", strlen (", "));
|
||||||
else
|
else
|
||||||
first = False;
|
first = False;
|
||||||
|
|
||||||
(void) write (fd, branch_name, strlen (branch_name));
|
rv = write (fd, branch_name, strlen (branch_name));
|
||||||
|
|
||||||
i++;
|
i++;
|
||||||
branch_name = (*value)[i];
|
branch_name = (*value)[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
(void) write (fd, "\n", strlen ("\n"));
|
rv = write (fd, "\n", strlen ("\n"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2580,10 +2589,11 @@ SelectionListToString(
|
||||||
Boolean first = True;
|
Boolean first = True;
|
||||||
FileViewData * file_view_data;
|
FileViewData * file_view_data;
|
||||||
DirectorySet * directory_set;
|
DirectorySet * directory_set;
|
||||||
|
int rv; /* probably should actually check this... */
|
||||||
|
|
||||||
if (*value != NULL)
|
if (*value != NULL)
|
||||||
{
|
{
|
||||||
(void) write (fd, out_buf, strlen (out_buf));
|
rv = write (fd, out_buf, strlen (out_buf));
|
||||||
|
|
||||||
i = 0;
|
i = 0;
|
||||||
file_view_data = (*value)[i];
|
file_view_data = (*value)[i];
|
||||||
|
@ -2594,24 +2604,24 @@ SelectionListToString(
|
||||||
directory_set = (DirectorySet *) file_view_data->directory_set;
|
directory_set = (DirectorySet *) file_view_data->directory_set;
|
||||||
|
|
||||||
if (!first)
|
if (!first)
|
||||||
(void) write (fd, ", ", strlen (", "));
|
rv = write (fd, ", ", strlen (", "));
|
||||||
else
|
else
|
||||||
first = False;
|
first = False;
|
||||||
|
|
||||||
|
|
||||||
(void) write (fd, directory_set->name, strlen (directory_set->name));
|
rv = write (fd, directory_set->name, strlen (directory_set->name));
|
||||||
|
|
||||||
if (strcmp (directory_set->name, "/") != 0)
|
if (strcmp (directory_set->name, "/") != 0)
|
||||||
(void) write (fd, "/", strlen ("/"));
|
rv = write (fd, "/", strlen ("/"));
|
||||||
|
|
||||||
(void) write (fd, file_view_data->file_data->file_name,
|
rv = write (fd, file_view_data->file_data->file_name,
|
||||||
strlen (file_view_data->file_data->file_name));
|
strlen (file_view_data->file_data->file_name));
|
||||||
|
|
||||||
i++;
|
i++;
|
||||||
file_view_data = (*value)[i];
|
file_view_data = (*value)[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
(void) write (fd, "\n", strlen ("\n"));
|
rv = write (fd, "\n", strlen ("\n"));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -5519,7 +5529,7 @@ CheckMoveType(
|
||||||
Atom pCurrent;
|
Atom pCurrent;
|
||||||
Screen *currentScreen;
|
Screen *currentScreen;
|
||||||
int screen;
|
int screen;
|
||||||
char * workspace_name;
|
char * workspace_name = NULL;
|
||||||
Display *display;
|
Display *display;
|
||||||
Boolean value;
|
Boolean value;
|
||||||
|
|
||||||
|
@ -5719,7 +5729,7 @@ CheckMoveType(
|
||||||
{
|
{
|
||||||
int len = strlen(to);
|
int len = strlen(to);
|
||||||
char notHere = 0x0;
|
char notHere = 0x0;
|
||||||
int workspace_num;
|
int workspace_num = 1;
|
||||||
|
|
||||||
for( i = 0; i < desktop_data->numWorkspaces; ++i )
|
for( i = 0; i < desktop_data->numWorkspaces; ++i )
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue