subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From danie...@apache.org
Subject svn commit: r1459858 - /subversion/trunk/subversion/libsvn_subr/version.c
Date Fri, 22 Mar 2013 15:59:11 GMT
Author: danielsh
Date: Fri Mar 22 15:59:11 2013
New Revision: 1459858

URL: http://svn.apache.org/r1459858
Log:
* subversion/libsvn_subr/version.c
  (svn_version__parse_version_string): Include the input string
     in error messages.

Modified:
    subversion/trunk/subversion/libsvn_subr/version.c

Modified: subversion/trunk/subversion/libsvn_subr/version.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/version.c?rev=1459858&r1=1459857&r2=1459858&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/version.c (original)
+++ subversion/trunk/subversion/libsvn_subr/version.c Fri Mar 22 15:59:11 2013
@@ -206,7 +206,9 @@ svn_version__parse_version_string(svn_ve
     svn_cstring_split(version_string, ".", FALSE, result_pool);
 
   if ((pieces->nelts < 2) || (pieces->nelts > 3))
-    return svn_error_create(SVN_ERR_MALFORMED_VERSION_STRING, NULL, NULL);
+    return svn_error_createf(SVN_ERR_MALFORMED_VERSION_STRING, NULL,
+                             _("Failed to parse version number string '%s'"),
+                             version_string);
 
   version = apr_pcalloc(result_pool, sizeof(*version));
   version->tag = "";
@@ -215,11 +217,15 @@ svn_version__parse_version_string(svn_ve
   err = svn_cstring_atoi(&(version->major),
                          APR_ARRAY_IDX(pieces, 0, const char *));
   if (err)
-    return svn_error_create(SVN_ERR_MALFORMED_VERSION_STRING, err, NULL);
+    return svn_error_createf(SVN_ERR_MALFORMED_VERSION_STRING, err,
+                             _("Failed to parse version number string '%s'"),
+                             version_string);
   err = svn_cstring_atoi(&(version->minor),
                          APR_ARRAY_IDX(pieces, 1, const char *));
   if (err)
-    return svn_error_create(SVN_ERR_MALFORMED_VERSION_STRING, err, NULL);
+    return svn_error_createf(SVN_ERR_MALFORMED_VERSION_STRING, err,
+                             _("Failed to parse version number string '%s'"),
+                             version_string);
 
   /* If there's a third component, we'll parse it, too.  But we don't
      require that it be present. */
@@ -234,13 +240,16 @@ svn_version__parse_version_string(svn_ve
         }
       err = svn_cstring_atoi(&(version->patch), piece);
       if (err)
-        return svn_error_create(SVN_ERR_MALFORMED_VERSION_STRING,
-                                err, NULL);
+        return svn_error_createf(SVN_ERR_MALFORMED_VERSION_STRING, err,
+                                 _("Failed to parse version number string '%s'"
+                                  ),
+                                 version_string);
     }
 
   if (version->major < 0 || version->minor < 0 || version->patch < 0)
-    return svn_error_create(SVN_ERR_MALFORMED_VERSION_STRING,
-                            err, NULL);
+    return svn_error_createf(SVN_ERR_MALFORMED_VERSION_STRING, err,
+                             _("Failed to parse version number string '%s'"),
+                             version_string);
 
   *version_p = version;
   return SVN_NO_ERROR;



Mime
View raw message