aboutsummaryrefslogtreecommitdiffstats
path: root/src/blogc-git-receiver/shell-command-parser.c
diff options
context:
space:
mode:
authorRafael G. Martins <rafael@rafaelmartins.eng.br>2018-04-05 22:35:25 +0200
committerRafael G. Martins <rafael@rafaelmartins.eng.br>2018-04-05 22:35:35 +0200
commitc43b487246fdfd2ddc5c794763b18255ac6a318e (patch)
treec5b2b5ef837e9e796842155a6f7943745c61d135 /src/blogc-git-receiver/shell-command-parser.c
parent0a7f6a2659b363e1d68202b9fd863b57f7420f4f (diff)
downloadblogc-c43b487246fdfd2ddc5c794763b18255ac6a318e.tar.gz
blogc-c43b487246fdfd2ddc5c794763b18255ac6a318e.tar.bz2
blogc-c43b487246fdfd2ddc5c794763b18255ac6a318e.zip
*: use squareball
yeah, changed my mind again :)
Diffstat (limited to 'src/blogc-git-receiver/shell-command-parser.c')
-rw-r--r--src/blogc-git-receiver/shell-command-parser.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/blogc-git-receiver/shell-command-parser.c b/src/blogc-git-receiver/shell-command-parser.c
index 05a68fd..842c67a 100644
--- a/src/blogc-git-receiver/shell-command-parser.c
+++ b/src/blogc-git-receiver/shell-command-parser.c
@@ -9,7 +9,8 @@
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
-#include "../common/utils.h"
+#include <squareball.h>
+
#include "shell-command-parser.h"
typedef enum {
@@ -28,7 +29,7 @@ bgr_shell_command_parse(const char *command)
size_t start = 0;
size_t command_len = strlen(command);
- bc_string_t *rv = bc_string_new();
+ sb_string_t *rv = sb_string_new();
for (size_t current = 0; current < command_len; current++) {
@@ -76,7 +77,7 @@ bgr_shell_command_parse(const char *command)
case START_ESCAPED:
if (c == '!' || c == '\'') {
- bc_string_append_c(rv, c);
+ sb_string_append_c(rv, c);
state = START_REPO;
break;
}
@@ -84,7 +85,7 @@ bgr_shell_command_parse(const char *command)
case REPO:
if (c == '\'') {
- bc_string_append_len(rv, command + start, current - start);
+ sb_string_append_len(rv, command + start, current - start);
state = START_REPO;
break;
}
@@ -93,9 +94,9 @@ bgr_shell_command_parse(const char *command)
}
if (rv->len > 0)
- return bc_string_free(rv, false);
+ return sb_string_free(rv, false);
error:
- bc_string_free(rv, true);
+ sb_string_free(rv, true);
return NULL;
}