From c645f3660d9361a0a9ca8b0fd55b54d2f5007835 Mon Sep 17 00:00:00 2001 From: Andrea Weikert Date: Tue, 28 Jul 2009 18:20:16 +0000 Subject: [PATCH] 2.5 file browser * Bugfix: keep the filename when changing directory, either by clicking on it or by selecting a bookmark * MSVC uninitialized variable runtime check fix in widget_draw_text --- source/blender/editors/interface/interface_widgets.c | 2 +- source/blender/editors/space_file/file_ops.c | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c index 485f8a2e1e7..cea3038b901 100644 --- a/source/blender/editors/interface/interface_widgets.c +++ b/source/blender/editors/interface/interface_widgets.c @@ -780,7 +780,7 @@ static void widget_draw_text(uiFontStyle *fstyle, uiWidgetColors *wcol, uiBut *b /* text button selection and cursor */ if(but->editstr && but->pos != -1) { - short t, pos, ch; + short t=0, pos=0, ch; short selsta_tmp, selend_tmp, selsta_draw, selwidth_draw; if ((but->selend - but->selsta) > 0) { diff --git a/source/blender/editors/space_file/file_ops.c b/source/blender/editors/space_file/file_ops.c index c515ef6e295..65a46d6514d 100644 --- a/source/blender/editors/space_file/file_ops.c +++ b/source/blender/editors/space_file/file_ops.c @@ -157,7 +157,6 @@ static FileSelect file_select(SpaceFile* sfile, ARegion* ar, const rcti* rect, s BLI_add_slash(params->dir); } - params->file[0] = '\0'; file_change_dir(sfile); retval = FILE_SELECT_DIR; } @@ -322,7 +321,6 @@ static int bookmark_select_invoke(bContext *C, wmOperator *op, wmEvent *event) BLI_strncpy(params->dir, entry, sizeof(params->dir)); BLI_cleanup_dir(G.sce, params->dir); file_change_dir(sfile); - params->file[0] = '\0'; WM_event_add_notifier(C, NC_FILE|ND_FILELIST, NULL); }