summaryrefslogtreecommitdiff
path: root/alias.c
diff options
context:
space:
mode:
authorFelipe Contreras <felipe.contreras@gmail.com>2013-09-21 14:15:44 -0500
committerJunio C Hamano <gitster@pobox.com>2013-10-16 10:27:26 -0700
commitcc10837929b2afe4116bb305e69b4bd4a95958de (patch)
tree46d1db02a6f2a86b9ec6dbe0eda5c221fa940ca2 /alias.c
parentc01499ef6933bd0e3fc65277559dc80f13d6a49e (diff)
downloadgit-cc10837929b2afe4116bb305e69b4bd4a95958de.tar.gz
alias: have SP around arithmetic operators
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'alias.c')
-rw-r--r--alias.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/alias.c b/alias.c
index eb9f08b912..9938f03c25 100644
--- a/alias.c
+++ b/alias.c
@@ -5,7 +5,7 @@ static char *alias_val;
static int alias_lookup_cb(const char *k, const char *v, void *cb)
{
- if (!prefixcmp(k, "alias.") && !strcmp(k+6, alias_key)) {
+ if (!prefixcmp(k, "alias.") && !strcmp(k + 6, alias_key)) {
if (!v)
return config_error_nonbool(k);
alias_val = xstrdup(v);
@@ -34,7 +34,7 @@ int split_cmdline(char *cmdline, const char ***argv)
int src, dst, count = 0, size = 16;
char quoted = 0;
- *argv = xmalloc(sizeof(char *) * size);
+ *argv = xmalloc(sizeof(**argv) * size);
/* split alias_string */
(*argv)[count++] = cmdline;
@@ -45,7 +45,7 @@ int split_cmdline(char *cmdline, const char ***argv)
while (cmdline[++src]
&& isspace(cmdline[src]))
; /* skip */
- ALLOC_GROW(*argv, count+1, size);
+ ALLOC_GROW(*argv, count + 1, size);
(*argv)[count++] = cmdline + dst;
} else if (!quoted && (c == '\'' || c == '"')) {
quoted = c;
@@ -76,12 +76,13 @@ int split_cmdline(char *cmdline, const char ***argv)
return -SPLIT_CMDLINE_UNCLOSED_QUOTE;
}
- ALLOC_GROW(*argv, count+1, size);
+ ALLOC_GROW(*argv, count + 1, size);
(*argv)[count] = NULL;
return count;
}
-const char *split_cmdline_strerror(int split_cmdline_errno) {
- return split_cmdline_errors[-split_cmdline_errno-1];
+const char *split_cmdline_strerror(int split_cmdline_errno)
+{
+ return split_cmdline_errors[-split_cmdline_errno - 1];
}