summaryrefslogtreecommitdiff
path: root/src/ptx.c
diff options
context:
space:
mode:
authorPádraig Brady <P@draigBrady.com>2009-09-23 10:10:51 +0100
committerPádraig Brady <P@draigBrady.com>2009-09-23 14:33:40 +0100
commita037e838e15c9a698f1634398e0fe2726398d575 (patch)
tree7361ac5f2c3dbd8fc4763e6fa960e6646670dc79 /src/ptx.c
parentade8dd2096e1898edefadf2314d4e1ec654adda5 (diff)
downloadcoreutils-a037e838e15c9a698f1634398e0fe2726398d575.tar.xz
maint: Use logical rather than bitwise operators on bools
This is because bitwise operators are: - confusing and inconsistent in a boolean context - non short circuiting - brittle in C89 where bool can be an int (so > 1)
Diffstat (limited to 'src/ptx.c')
-rw-r--r--src/ptx.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/ptx.c b/src/ptx.c
index 49cbe89c9..4947a0f91 100644
--- a/src/ptx.c
+++ b/src/ptx.c
@@ -455,7 +455,7 @@ initialize_regex (void)
if (!*context_regex.string)
context_regex.string = NULL;
}
- else if (gnu_extensions & !input_reference)
+ else if (gnu_extensions && !input_reference)
context_regex.string = "[.?!][]\"')}]*\\($\\|\t\\| \\)[ \t\n]*";
else
context_regex.string = "\n";
@@ -1296,7 +1296,7 @@ fix_output_parameters (void)
/* If the reference appears to the left of the output line, reserve some
space for it right away, including one gap size. */
- if ((auto_reference | input_reference) & !right_reference)
+ if ((auto_reference || input_reference) && !right_reference)
line_width -= reference_max_width + gap_size;
/* The output lines, minimally, will contain from left to right a left
@@ -1660,7 +1660,7 @@ output_one_roff_line (void)
/* Conditionally output the `reference' field. */
- if (auto_reference | input_reference)
+ if (auto_reference || input_reference)
{
fputs (" \"", stdout);
print_field (reference);
@@ -1699,7 +1699,7 @@ output_one_tex_line (void)
fputs ("}{", stdout);
print_field (head);
putchar ('}');
- if (auto_reference | input_reference)
+ if (auto_reference || input_reference)
{
putchar ('{');
print_field (reference);
@@ -1791,12 +1791,12 @@ output_one_dumb_line (void)
}
else
- if ((auto_reference | input_reference) & right_reference)
+ if ((auto_reference || input_reference) && right_reference)
print_spaces (half_line_width
- (keyafter.end - keyafter.start)
- (keyafter_truncation ? truncation_string_length : 0));
- if ((auto_reference | input_reference) & right_reference)
+ if ((auto_reference || input_reference) && right_reference)
{
/* Output the `reference' field. */