Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/editors/space_file')
-rw-r--r--source/blender/editors/space_file/file_panels.c8
-rw-r--r--source/blender/editors/space_file/filelist.c4
-rw-r--r--source/blender/editors/space_file/fsmenu.c2
-rw-r--r--source/blender/editors/space_file/fsmenu.h2
4 files changed, 9 insertions, 7 deletions
diff --git a/source/blender/editors/space_file/file_panels.c b/source/blender/editors/space_file/file_panels.c
index 86cd4a967f1..109c5f0fdf6 100644
--- a/source/blender/editors/space_file/file_panels.c
+++ b/source/blender/editors/space_file/file_panels.c
@@ -68,7 +68,6 @@ static void file_panel_category(const bContext *C, Panel *pa, FSMenuCategory cat
uiBut *but;
uiLayout *box, *col;
struct FSMenu* fsmenu = fsmenu_get();
- char *curdir= (sfile->params)? sfile->params->dir: "";
int i, i_iter, nentries = fsmenu_get_nentries(fsmenu, category);
/* reset each time */
@@ -95,8 +94,11 @@ static void file_panel_category(const bContext *C, Panel *pa, FSMenuCategory cat
entry = fsmenu_get_entry(fsmenu, category, i);
/* set this list item as active if we have a match */
- if(strcmp(curdir, entry) == 0)
- *nr= i;
+ if(sfile->params) {
+ if(strcmp(sfile->params->dir, entry) == 0) {
+ *nr= i;
+ }
+ }
/* create nice bookmark name, shows last directory in the full path currently */
BLI_strncpy(temp, entry, FILE_MAX);
diff --git a/source/blender/editors/space_file/filelist.c b/source/blender/editors/space_file/filelist.c
index 41ad7ad3503..c476b5d8cde 100644
--- a/source/blender/editors/space_file/filelist.c
+++ b/source/blender/editors/space_file/filelist.c
@@ -238,8 +238,8 @@ static int compare_size(const void *a1, const void *a2)
static int compare_extension(const void *a1, const void *a2) {
const struct direntry *entry1=a1, *entry2=a2;
- char *sufix1, *sufix2;
- char *nil="";
+ const char *sufix1, *sufix2;
+ const char *nil="";
if (!(sufix1= strstr (entry1->relname, ".blend.gz")))
sufix1= strrchr (entry1->relname, '.');
diff --git a/source/blender/editors/space_file/fsmenu.c b/source/blender/editors/space_file/fsmenu.c
index a043fc8cfd1..2856f0f4fdf 100644
--- a/source/blender/editors/space_file/fsmenu.c
+++ b/source/blender/editors/space_file/fsmenu.c
@@ -157,7 +157,7 @@ short fsmenu_can_save (struct FSMenu* fsmenu, FSMenuCategory category, int idx)
return fsme?fsme->save:0;
}
-void fsmenu_insert_entry(struct FSMenu* fsmenu, FSMenuCategory category, char *path, int sorted, short save)
+void fsmenu_insert_entry(struct FSMenu* fsmenu, FSMenuCategory category, const char *path, int sorted, short save)
{
FSMenuEntry *prev;
FSMenuEntry *fsme;
diff --git a/source/blender/editors/space_file/fsmenu.h b/source/blender/editors/space_file/fsmenu.h
index dcf8d3eb632..d499f439f65 100644
--- a/source/blender/editors/space_file/fsmenu.h
+++ b/source/blender/editors/space_file/fsmenu.h
@@ -56,7 +56,7 @@ char* fsmenu_get_entry (struct FSMenu* fsmenu, FSMenuCategory category, int ind
* Duplicate entries are not added.
* @param sorted Should entry be inserted in sorted order?
*/
-void fsmenu_insert_entry (struct FSMenu* fsmenu, FSMenuCategory category, char *path, int sorted, short save);
+void fsmenu_insert_entry (struct FSMenu* fsmenu, FSMenuCategory category, const char *path, int sorted, short save);
/** Return whether the entry was created by the user and can be saved and deleted */
short fsmenu_can_save (struct FSMenu* fsmenu, FSMenuCategory category, int index);