diff --git a/cmdline/stress.c b/cmdline/stress.c index 3854efb3..96732878 100644 --- a/cmdline/stress.c +++ b/cmdline/stress.c @@ -235,9 +235,9 @@ void stress_functions(dc_context_t* context) assert( dc_get_filebytes(context, "$BLOBDIR/foobar")==7 ); char* absPath = dc_mprintf("%s/%s", context->blobdir, "foobar"); - assert( dc_is_in_blobdir(context, absPath) ); - assert( dc_is_in_blobdir(context, "$BLOBDIR/fofo") ); - assert( !dc_is_in_blobdir(context, "/BLOBDIR/fofo") ); + assert( dc_is_blobdir_path(context, absPath) ); + assert( dc_is_blobdir_path(context, "$BLOBDIR/fofo") ); + assert( !dc_is_blobdir_path(context, "/BLOBDIR/fofo") ); assert( dc_file_exist(context, absPath) ); free(absPath); diff --git a/src/dc_chat.c b/src/dc_chat.c index aafa39c0..92d3ff1d 100644 --- a/src/dc_chat.c +++ b/src/dc_chat.c @@ -2179,7 +2179,7 @@ uint32_t dc_send_msg(dc_context_t* context, uint32_t chat_id, dc_msg_t* msg) goto cleanup; } - if (dc_msg_is_increation(msg) && !dc_is_in_blobdir(context, pathNfilename)) { + if (dc_msg_is_increation(msg) && !dc_is_blobdir_path(context, pathNfilename)) { dc_log_error(context, 0, "Files must be created in the blob-directory."); goto cleanup; } diff --git a/src/dc_tools.c b/src/dc_tools.c index 236094a4..39e4e8d2 100644 --- a/src/dc_tools.c +++ b/src/dc_tools.c @@ -1431,10 +1431,10 @@ void dc_make_rel_path(dc_context_t* context, char** path) /** * Check if a path describes a file in the blob directory. - * The path can be give absolute or relative (starting with `$BLOBDIR`). + * The path can be absolute or relative (starting with `$BLOBDIR`). * The function does not check if the file really exists. */ -int dc_is_in_blobdir(dc_context_t* context, const char* path) +int dc_is_blobdir_path(dc_context_t* context, const char* path) { if ((strncmp(path, context->blobdir, strlen(context->blobdir))==0) || (strncmp(path, "$BLOBDIR", 8)==0)) { @@ -1462,7 +1462,7 @@ int dc_make_rel_and_copy(dc_context_t* context, char** path) goto cleanup; } - if (dc_is_in_blobdir(context, *path)) { + if (dc_is_blobdir_path(context, *path)) { dc_make_rel_path(context, path); success = 1; // file is already in blobdir goto cleanup; diff --git a/src/dc_tools.h b/src/dc_tools.h index 5d7aa6e2..2227f708 100644 --- a/src/dc_tools.h +++ b/src/dc_tools.h @@ -110,7 +110,7 @@ int dc_create_folder (dc_context_t*, const char* pathNfilename); int dc_write_file (dc_context_t*, const char* pathNfilename, const void* buf, size_t buf_bytes); int dc_read_file (dc_context_t*, const char* pathNfilename, void** buf, size_t* buf_bytes); char* dc_get_fine_pathNfilename (dc_context_t*, const char* pathNfolder, const char* desired_name); -int dc_is_in_blobdir (dc_context_t*, const char* path); +int dc_is_blobdir_path (dc_context_t*, const char* path); void dc_make_rel_path (dc_context_t*, char** pathNfilename); int dc_make_rel_and_copy (dc_context_t*, char** pathNfilename);