Actually, "%Y%" and "%M%" are also subject to 
expansion by sccs, so here's another version of the patch
(diff'd from the original version of date.c),
to avoid the replacement of those strings as well.

Thanks,
        April 
> Date: Mon, 30 Oct 2006 03:17:42 +0100
> From: Roland Mainz <roland.mainz at nrubsig.org>
> X-Accept-Language: en
> MIME-Version: 1.0
> To: Glenn Fowler <gsf at research.att.com>
> CC: ksh93-integration-discuss <ksh93-integration-discuss at opensolaris.org>, 
April Chin <April.Chin at eng.sun.com>
> Subject: ksh93 libcmd/common/date.c patch to make SCCS happy...
> 
> 
> Hi!
> 
> ----
> 
> Attached is a small patch ("ksh93_sccs_patch001.diff") from April which
> fixes a small problem with Sun's SCCS (version control software used for
> OS/Net).
> SCCS replaces all "%H%" strings with another value during checkout,
> breaking the builtin "date" command in this case. The attached patch
> fixes this via splitting "%H%" into two string literals (e.g. "%" "H%")
> ...
> 
> ----
> 
> Bye,
> Roland
> 
> -- 
>   __ .  . __
>  (o.\ \/ /.o) roland.mainz at nrubsig.org
>   \__\/\/__/  MPEG specialist, C&&JAVA&&Sun&&Unix programmer
>   /O /==\ O\  TEL +49 641 7950090
>  (;O/ \/ \O;)
-------------- next part --------------
Index: common/date.c
===================================================================
--- common/date.c       (revision 502)
+++ common/date.c       (working copy)
@@ -220,13 +220,23 @@
                *argv++ = s;
                if (streq(astconf("UNIVERSE", NiL, NiL), "att"))
                {
-                       tmxfmt(buf, sizeof(buf), "%m%d%H%M%Y.%S", now);
+                       /*
+                        * The string has been split to avoid expansion
+                        * of the strings "percent H percent" and "percent
+                        * M percent" by sccs (source code control system)
+                        */
+                       tmxfmt(buf, sizeof(buf), "%m%d%H" "%M" "%Y.%S", now);
                        if (adjust)
                                *argv++ = "-a";
                }
                else
                {
-                       tmxfmt(buf, sizeof(buf), "%Y%m%d%H%M.%S", now);
+                       /*
+                        * The string has been split to avoid expansion
+                        * of the strings "percent H percent" and "percent
+                        * Y percent" by sccs (source code control system).
+                        */
+                       tmxfmt(buf, sizeof(buf), "%Y" "%m%d%H" "%M.%S", now);
                        if (network)
                                *argv++ = "-n";
                        if (tm_info.flags & TM_UTC)

Reply via email to