Cleanup: remove NULL check and outdated comment

This commit is contained in:
Campbell Barton 2022-04-26 14:02:49 +10:00
parent c63a6d3057
commit a32f447c54
2 changed files with 4 additions and 5 deletions

View File

@ -38,13 +38,14 @@ bool BKE_text_reload(struct Text *text);
struct Text *BKE_text_load_ex(struct Main *bmain,
const char *filepath,
const char *relbase,
bool is_internal);
bool is_internal) ATTR_NONNULL(1, 2, 3);
/**
* Load a text file.
*
* \note Text data-blocks have no user by default, only the 'real user' flag.
*/
struct Text *BKE_text_load(struct Main *bmain, const char *filepath, const char *relbase);
struct Text *BKE_text_load(struct Main *bmain, const char *filepath, const char *relbase)
ATTR_NONNULL(1, 2, 3);
void BKE_text_clear(struct Text *text) ATTR_NONNULL(1);
void BKE_text_write(struct Text *text, const char *str, int str_len) ATTR_NONNULL(1, 2);
/**

View File

@ -466,9 +466,7 @@ Text *BKE_text_load_ex(Main *bmain,
BLI_stat_t st;
BLI_strncpy(filepath_abs, filepath, FILE_MAX);
if (relbase) { /* Can be NULL (background mode). */
BLI_path_abs(filepath_abs, relbase);
}
BLI_path_abs(filepath_abs, relbase);
buffer = BLI_file_read_text_as_mem(filepath_abs, 0, &buffer_len);
if (buffer == NULL) {