[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
CVS Keyword expansion patch
From: |
Scott James Remnant |
Subject: |
CVS Keyword expansion patch |
Date: |
12 Mar 2003 11:44:38 +0000 |
A simple patch for you to consider,
It's possible to trip over Keyword expansion when using Perl because
code like " $Header::fields{$value} " ends up being quite a common
occurrence.
CVS would see the "$Header:.....$" in the above and you end up with
bogus code. Simply setting -kb isn't the right thing, because you
generally DO want keyword expansion in the comments at the top, amongst
other places.
I therefore submit this patch, basically it prevents keyword expansion
if the keyword ends in "::"
----8<--------8<--------8<--------8<--------8<--------8<--------8<----
diff -urN cvs-1.11.5.orig/src/rcs.c cvs-1.11.5/src/rcs.c
--- cvs-1.11.5.orig/src/rcs.c Thu Jan 16 15:10:55 2003
+++ cvs-1.11.5/src/rcs.c Wed Mar 12 11:39:08 2003
@@ -3689,6 +3689,11 @@
keyword after all. */
if (*s == ':')
{
+ /* If the keyword ends with '::', then this wasn't a keyword
+ after all, but a Perl variable! */
+ if (*(s + 1) == ':')
+ continue;
+
for (; s < send; s++)
if (*s == '$' || *s == '\n')
break;
---->8-------->8-------->8-------->8-------->8-------->8-------->8----
Scott
--
sjr software and systems engineer
demon internet, thus plc