diff options
author | Andrea Weikert <elubie@gmx.net> | 2007-02-21 23:00:03 +0300 |
---|---|---|
committer | Andrea Weikert <elubie@gmx.net> | 2007-02-21 23:00:03 +0300 |
commit | f12d3122752a947d2b72a63a8b9146a962ccb77b (patch) | |
tree | 63ba5398d85b9c4cde8ac3a3f8a2aaf0452d79a0 /source/blender/blenlib | |
parent | 3a2c58b6ecc71ba92eb948f075d661099a51db47 (diff) |
=== bugfix ===
- path without volume name still caused error when used as name for relative base
- could happen with name in .Blog file saved by older blender version
- fix for [ #6065 ] Blender refuses to save any renders
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r-- | source/blender/blenlib/intern/util.c | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/source/blender/blenlib/intern/util.c b/source/blender/blenlib/intern/util.c index 29e15068f15..590dd7beb5b 100644 --- a/source/blender/blenlib/intern/util.c +++ b/source/blender/blenlib/intern/util.c @@ -759,13 +759,27 @@ void BLI_makestringcode(const char *relfile, char *file) /* also bail out if relative path is not set */ if (relfile[0] == 0) return; - strcpy(temp, relfile); - -#ifdef WIN32 +#ifdef WIN32 + if (strlen(relfile) > 2 && relfile[1] != ':') { + char* ptemp; + /* fix missing volume name in relative base, + can happen with old .Blog files */ + get_default_root(temp); + ptemp = &temp[2]; + if (relfile[0] != '\\' && relfile[0] != '/') { + ptemp++; + } + BLI_strncpy(ptemp, relfile, FILE_MAXDIR + FILE_MAXFILE-3); + } else { + BLI_strncpy(temp, relfile, FILE_MAXDIR + FILE_MAXFILE); + } + if (strlen(file) > 2) { if ( temp[1] == ':' && file[1] == ':' && temp[0] != file[0] ) return; } +#else + BLI_strncpy(temp, relfile, FILE_MAX); #endif BLI_char_switch(temp, '\\', '/'); |