Hi again!

patch(1p) specifies for '-D define' that

  If the patched file is processed with the C preprocessor,
  where the macro 'define' is defined, the output shall contain
  the changes from the patch file; otherwise, the output shall
  not contain the patches specified in the patch file.

I interpret this as implying that a patched C must be at least
as syntactically correct after patching as before patching.

If you have two files:

  1\
  2

and

  1\
  new
  2

If the former is patched with -Dx than the result is

  1\
  #ifdef x
  new
  #endif
  2

Because of the backslash at the end of the first line that
result is not syntactically correct. Therefore, patch must
look out for line continuations and comments, and not be
fooled by /* that appear inside string literals.


Sincerely,
Mattias Andrée

Attachment: pgpdJmZpYwqUe.pgp
Description: OpenPGP digital signature

Reply via email to