diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-07-06 12:10:41 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-07-06 12:10:41 +0400 |
commit | 96953c748f06a3cc6725d9a1d0927c46d50aed2b (patch) | |
tree | 4426a1ec26fd7f3e36a3ad91566cac4c458cc6bf /source/blender/editors/space_image | |
parent | ae754c6384e212678b5d41bd0b8ddf38b31a3f07 (diff) |
fix [#36022] inconsistent naming for new images
Diffstat (limited to 'source/blender/editors/space_image')
-rw-r--r-- | source/blender/editors/space_image/image_ops.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c index 20bbfbbf343..88f67def30a 100644 --- a/source/blender/editors/space_image/image_ops.c +++ b/source/blender/editors/space_image/image_ops.c @@ -1253,13 +1253,8 @@ static int save_image_options_init(SaveImageOptions *simopts, SpaceImage *sima, /* check for empty path */ if (guess_path && simopts->filepath[0] == 0) { - if ((G.ima[0] == '/') && (G.ima[1] == '/') && (G.ima[2] == '\0')) { - BLI_strncpy(simopts->filepath, "//untitled", FILE_MAX); - } - else { - BLI_strncpy(simopts->filepath, G.ima, FILE_MAX); - } - BLI_path_abs(simopts->filepath, G.main->name); + BLI_snprintf(simopts->filepath, sizeof(simopts->filepath), "//%s", ima->id.name + 2); + BLI_path_abs(simopts->filepath, STREQ(G.ima, "//") ? G.main->name : G.ima); } /* color management */ |