subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rsch...@apache.org
Subject svn commit: r1767768 - /subversion/trunk/subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.c
Date Wed, 02 Nov 2016 19:32:06 GMT
Author: rschupp
Date: Wed Nov  2 19:32:05 2016
New Revision: 1767768

URL: http://svn.apache.org/viewvc?rev=1767768&view=rev
Log:
* subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.c:
  (svn_swig_pl_set_revision) When parsing a revision given as "{DATE}", 
  restore the closing brace afterwards. Modify error messages to
  include the originally passed-in string.
  Original patch by Rainer Müller.

Modified:
    subversion/trunk/subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.c

Modified: subversion/trunk/subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.c?rev=1767768&r1=1767767&r2=1767768&view=diff
==============================================================================
--- subversion/trunk/subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.c (original)
+++ subversion/trunk/subversion/bindings/swig/perl/libsvn_swig_perl/swigutil_pl.c Wed Nov
 2 19:32:05 2016
@@ -467,20 +467,23 @@ svn_opt_revision_t *svn_swig_pl_set_revi
             svn_error_t *err;
 
             char *end = strchr(input,'}');
+            char saved_end;
             if (!end)
                 maybe_croak(("unknown opt_revision_t string \"%s\": "
                              "missing closing brace for \"{DATE}\"", input));
+            saved_end = *end;
             *end = '\0';
             err = svn_parse_date (&matched, &tm,
                                   input + 1, apr_time_now(), pool);
+            *end = saved_end;
             if (err) {
                 svn_error_clear (err);
-                maybe_croak(("unknown opt_revision_t string \"{%s}\": "
-                             "internal svn_parse_date error", input + 1));
+                maybe_croak(("unknown opt_revision_t string \"%s\": "
+                             "internal svn_parse_date error", input));
             }
             if (!matched)
-                maybe_croak(("unknown opt_revision_t string \"{%s}\": "
-                             "svn_parse_date failed to parse it", input + 1));
+                maybe_croak(("unknown opt_revision_t string \"%s\": "
+                             "svn_parse_date failed to parse it", input));
 
             rev->kind = svn_opt_revision_date;
             rev->value.date = tm;



Mime
View raw message