This is the mail archive of the cygwin-cvs@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[newlib-cygwin] Cygwin: mkvers: fix a bug in sed statement


https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=5b4de1c915e7f8db19bfe3907d1a301406a3ded7

commit 5b4de1c915e7f8db19bfe3907d1a301406a3ded7
Author: Corinna Vinschen <corinna@vinschen.de>
Date:   Sat Dec 1 16:50:40 2018 +0100

    Cygwin: mkvers: fix a bug in sed statement
    
    While reformatting the script, backticks `` were replaced with
    brackets $().  This in turn invalidated the \\( ... \\) expressions in the
    sed script because backslash resolution in $() works differently from
    backslash resolution in ``.  Only a single backslash is valid now.
    
    While at it, fix up the uname(2) date representation when building a
    snapshot.
    
    Signed-off-by: Corinna Vinschen <corinna@vinschen.de>

Diff:
---
 winsup/cygwin/mkvers.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/winsup/cygwin/mkvers.sh b/winsup/cygwin/mkvers.sh
index 5aecb14..6309c84 100755
--- a/winsup/cygwin/mkvers.sh
+++ b/winsup/cygwin/mkvers.sh
@@ -140,7 +140,8 @@ done | tee /tmp/mkvers.$$ 1>&9
 trap "rm -f /tmp/mkvers.$$" 0 1 2 15
 
 if [ -n "$snapshotdate" ]; then
-  usedate="$(echo $snapshotdate | sed 's/-\\(..:..[^-]*\\).*$/ \1SNP/')"
+  usedate="$(echo $snapshotdate \
+	     | sed -e 's/\(....\)\(..\)\(..\)-\(..:..\).*$/\1-\2-\3 \4SNP/')"
 else
   usedate="$builddate"
 fi


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]