cp: support conditional interpolation with \?'cond@expr1@expr2@'
commitbdcf22471658feadd37da3f16dbf98a95dc29dfa
authorAli Gholami Rudi <ali@rudi.ir>
Tue, 3 Jun 2014 16:46:45 +0000 (3 21:16 +0430)
committerAli Gholami Rudi <ali@rudi.ir>
Tue, 3 Jun 2014 16:46:45 +0000 (3 21:16 +0430)
tree7408ad565449abd544788823cd3978c37b46286c
parent3c3327f92ca9d383b829070b428dfc10425439f9
cp: support conditional interpolation with \?'cond@expr1@expr2@'

This adds a new escape sequence for conditional interpolation: the
escape sequence \?'cond@expr1@expr2@', evaluates cond (exactly as if
it is a .if condition) and interpolates expr1, if the condition is
true, and expr2, otherwise.  The delimiter (@ in this example) can be
any character that cannot be part of the condition; for numerical
expressions, for instance, it cannot be a digit, an operator sign, or
a scale indicator, unless separated from the condition with \&.  The
final delimiter may be omitted.  Note that this escape sequence is not
interpolated in copy-mode.
char.c
cp.c
roff.h