diff options
| author | Rafael G. Martins <rafael@rafaelmartins.eng.br> | 2019-09-02 23:38:48 +0200 | 
|---|---|---|
| committer | Rafael G. Martins <rafael@rafaelmartins.eng.br> | 2019-09-02 23:51:15 +0200 | 
| commit | 4763814c683c50f8a3697b74e764f19c3dacccd5 (patch) | |
| tree | 386ff43f024705a32310b882f2161b5f86d8820a /src/blogc-git-receiver/shell.c | |
| parent | c12bdb94ecdc44f200a8030dfde4a5ec46053ea6 (diff) | |
| download | blogc-4763814c683c50f8a3697b74e764f19c3dacccd5.tar.gz blogc-4763814c683c50f8a3697b74e764f19c3dacccd5.tar.bz2 blogc-4763814c683c50f8a3697b74e764f19c3dacccd5.zip | |
migrate codebase to use squareball. again :)feature/squareball
Diffstat (limited to 'src/blogc-git-receiver/shell.c')
| -rw-r--r-- | src/blogc-git-receiver/shell.c | 13 | 
1 files changed, 7 insertions, 6 deletions
| diff --git a/src/blogc-git-receiver/shell.c b/src/blogc-git-receiver/shell.c index a460ac2..a9e5c45 100644 --- a/src/blogc-git-receiver/shell.c +++ b/src/blogc-git-receiver/shell.c @@ -13,7 +13,8 @@  #include <unistd.h>  #include <errno.h>  #include <sys/stat.h> -#include "../common/utils.h" +#include <squareball.h> +  #include "settings.h"  #include "shell-command-parser.h"  #include "shell.h" @@ -62,15 +63,15 @@ bgr_shell(int argc, char *argv[])          goto cleanup;      } -    repo = bc_strdup_printf("%s/repos/%s", bd, tmp_repo); -    quoted_repo = bc_shell_quote(repo); +    repo = sb_strdup_printf("%s/repos/%s", bd, tmp_repo); +    quoted_repo = sb_shell_quote(repo);      free(tmp_repo);      if (0 == strncmp(argv[2], "git-upload-", 11))  // no need to check len here          goto git_exec;      if (0 != access(repo, F_OK)) { -        char *git_init_cmd = bc_strdup_printf( +        char *git_init_cmd = sb_strdup_printf(              "git init --bare %s > /dev/null", quoted_repo);          if (0 != system(git_init_cmd)) {              fprintf(stderr, "error: failed to create git repository: %s\n", @@ -147,9 +148,9 @@ git_exec:          goto cleanup;      } -    // static allocation instead of bc_strdup_printf to avoid leaks +    // static allocation instead of sb_strdup_printf to avoid leaks      char buffer[4096]; -    char *command = bc_strdup(argv[2]); +    char *command = sb_strdup(argv[2]);      char *p;      for (p = command; *p != ' ' && *p != '\0'; p++);      if (*p == ' ') | 
