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 <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Junio C Hamano committed Oct 16, 2013 at 10:26 UTC c01499ef6933bd0e3fc65277559dc80f13d6a49e
5 files changed +5 -5
builtin/read-tree.c
+1 -1
@@ -178,7 +178,7 @@ int cmd_read_tree(int argc, const char **argv, const char *unused_prefix)
178
179 if (1 < opts.index_only + opts.update)
180 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)
182 die("%s is meaningless without -m, --reset, or --prefix",
183 opts.update ? "-u" : "-i");
184 if ((opts.dir && !opts.update))
builtin/rev-list.c
+1 -1
@@ -322,7 +322,7 @@ int cmd_rev_list(int argc, const char **argv, const char *prefix)
322 revs.commit_format = CMIT_FMT_RAW;
323
324 if ((!revs.commits &&
325 - (!(revs.tag_objects||revs.tree_objects||revs.blob_objects) &&
325 + (!(revs.tag_objects || revs.tree_objects || revs.blob_objects) &&
326 !revs.pending.nr)) ||
327 revs.diff)
328 usage(rev_list_usage);
builtin/symbolic-ref.c
+1 -1
@@ -47,7 +47,7 @@ int cmd_symbolic_ref(int argc, const char **argv, const char *prefix)
47 git_config(git_default_config, NULL);
48 argc = parse_options(argc, argv, prefix, options,
49 git_symbolic_ref_usage, 0);
50 - if (msg &&!*msg)
50 + if (msg && !*msg)
51 die("Refusing to perform update with empty message");
52
53 if (delete) {
compat/regex/regcomp.c
+1 -1
@@ -339,7 +339,7 @@ re_compile_fastmap_iter (regex_t *bufp, const re_dfastate_t *init_state,
339 p = buf;
340 *p++ = dfa->nodes[node].opr.c;
341 while (++node < dfa->nodes_len
342 - && dfa->nodes[node].type == CHARACTER
342 + && dfa->nodes[node].type == CHARACTER
343 && dfa->nodes[node].mb_partial)
344 *p++ = dfa->nodes[node].opr.c;
345 memset (&state, '\0', sizeof (state));
xdiff/xemit.c
+1 -1
@@ -108,7 +108,7 @@ static long def_ff(const char *rec, long len, char *buf, long sz, void *priv)
108 {
109 if (len > 0 &&
110 (isalpha((unsigned char)*rec) || /* identifier? */
111 - *rec == '_' || /* also identifier? */
111 + *rec == '_' || /* also identifier? */
112 *rec == '$')) { /* identifiers from VMS and other esoterico */
113 if (len > sz)
114 len = sz;