Style: Rename string_createcat_cc to string_concat_cc
This commit is contained in:
8
src/io.c
8
src/io.c
@@ -14,10 +14,10 @@ StringView path_concat_ss(StringPool *sp, StringView* a, StringView* b)
|
||||
if(b == NULL) DIE("b must be a valid string!");
|
||||
if(a->len <= 0 || b->len <= 0) DIE("a and b must not be empty! (a:%d, b:%d)", a->len, b->len);
|
||||
if(a->buf[a->len - 1] == '/')
|
||||
return string_createcat_ss(sp, a, b);
|
||||
return string_concat_ss(sp, a, b);
|
||||
StringView slash = (StringView){.buf = "/", .len = 1};
|
||||
StringView ts = string_createcat_ss(sp, a, &slash);
|
||||
return string_createcat_ss(sp, &ts, b);
|
||||
StringView ts = string_concat_ss(sp, a, &slash);
|
||||
return string_concat_ss(sp, &ts, b);
|
||||
}
|
||||
|
||||
// Utilize DFS for recursive directory search.
|
||||
@@ -40,7 +40,7 @@ size_t dir_get_recursive(DirOpContext* doc, StringView* p)
|
||||
if(de == NULL && errno != 0) DIE("failed to read directory: \"%s\"", p);
|
||||
if(de == NULL) break;
|
||||
|
||||
if(de->d_type == DT_UNKNOWN) DIE("Filesystem not supported!!");
|
||||
if(de->d_type == DT_UNKNOWN) DIE("Filesystem not supported!!"); // Add support for modern filesystems using stat()
|
||||
if(de->d_type != DT_DIR && de->d_type != DT_REG) continue;
|
||||
if(strcmp(de->d_name, ".") == 0 || strcmp(de->d_name, "..") == 0 || strcmp(de->d_name, ".git") == 0) continue;
|
||||
|
||||
|
||||
@@ -25,7 +25,6 @@ int main(void)
|
||||
Arena a_cmd = arena_create(&b, MEM_ARENA_MAX_CAP);
|
||||
|
||||
Configuration sample_config;
|
||||
|
||||
Command cmd = command_create(&a_cmd, &d, &sample_config);
|
||||
command_run(&cmd);
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ StringView string_create(StringPool* sp, const char* s, size_t len)
|
||||
return (StringView){.buf = buf, .len=len};
|
||||
}
|
||||
|
||||
StringView string_createcat_ss(StringPool* sp, StringView* a, StringView* b)
|
||||
StringView string_concat_ss(StringPool* sp, StringView* a, StringView* b)
|
||||
{
|
||||
if(a == NULL) DIE("a must be a valid C-style string!");
|
||||
if(b == NULL) DIE("b must be a valid C-style string!");
|
||||
|
||||
@@ -26,6 +26,6 @@ StringPool string_pool_create(Arena* a);
|
||||
StringView string_create(StringPool* sp, const char* s, size_t len);
|
||||
|
||||
// Ensure that lengths do not contain null term
|
||||
StringView string_createcat_ss(StringPool* sp, StringView* a, StringView* b);
|
||||
StringView string_concat_ss(StringPool* sp, StringView* a, StringView* b);
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user