Skip to content

Commit c01499e

Browse files
committed
C: have space around && and || operators
Correct all hits from git grep -e '\(&&\|||\)[^ ]' -e '[^ ]\(&&\|||\)' -- '*.c' i.e. && or || operators that are followed by anything but a SP, or that follow something other than a SP or a HT, so that these operators have a SP around it when necessary. We usually refrain from making this kind of a tree-wide change in order to avoid unnecessary conflicts with other "real work" patches, but in this case, the end result does not have a potentially cumbersome tree-wide impact, while this is a tree-wide cleanup. Fixes to compat/regex/regcomp.c and xdiff/xemit.c are to replace a HT immediately after && with a SP. This is based on Felipe's patch to bultin/symbolic-ref.c; I did all the finding out what other files in the whole tree need to be fixed and did the fix and also the log message while reviewing that single liner, so any screw-ups in this version are mine. Signed-off-by: Felipe Contreras <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 2b7ca91 commit c01499e

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

builtin/read-tree.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ int cmd_read_tree(int argc, const char **argv, const char *unused_prefix)
178178

179179
if (1 < opts.index_only + opts.update)
180180
die("-u and -i at the same time makes no sense");
181-
if ((opts.update||opts.index_only) && !opts.merge)
181+
if ((opts.update || opts.index_only) && !opts.merge)
182182
die("%s is meaningless without -m, --reset, or --prefix",
183183
opts.update ? "-u" : "-i");
184184
if ((opts.dir && !opts.update))

builtin/rev-list.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ int cmd_rev_list(int argc, const char **argv, const char *prefix)
322322
revs.commit_format = CMIT_FMT_RAW;
323323

324324
if ((!revs.commits &&
325-
(!(revs.tag_objects||revs.tree_objects||revs.blob_objects) &&
325+
(!(revs.tag_objects || revs.tree_objects || revs.blob_objects) &&
326326
!revs.pending.nr)) ||
327327
revs.diff)
328328
usage(rev_list_usage);

builtin/symbolic-ref.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ int cmd_symbolic_ref(int argc, const char **argv, const char *prefix)
4747
git_config(git_default_config, NULL);
4848
argc = parse_options(argc, argv, prefix, options,
4949
git_symbolic_ref_usage, 0);
50-
if (msg &&!*msg)
50+
if (msg && !*msg)
5151
die("Refusing to perform update with empty message");
5252

5353
if (delete) {

compat/regex/regcomp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ re_compile_fastmap_iter (regex_t *bufp, const re_dfastate_t *init_state,
339339
p = buf;
340340
*p++ = dfa->nodes[node].opr.c;
341341
while (++node < dfa->nodes_len
342-
&& dfa->nodes[node].type == CHARACTER
342+
&& dfa->nodes[node].type == CHARACTER
343343
&& dfa->nodes[node].mb_partial)
344344
*p++ = dfa->nodes[node].opr.c;
345345
memset (&state, '\0', sizeof (state));

xdiff/xemit.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ static long def_ff(const char *rec, long len, char *buf, long sz, void *priv)
108108
{
109109
if (len > 0 &&
110110
(isalpha((unsigned char)*rec) || /* identifier? */
111-
*rec == '_' || /* also identifier? */
111+
*rec == '_' || /* also identifier? */
112112
*rec == '$')) { /* identifiers from VMS and other esoterico */
113113
if (len > sz)
114114
len = sz;

0 commit comments

Comments
 (0)