[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [PATCH] Fix to svn_time_to_human_cstring() - take 3

From: Nicolás Lichtmaier <nick_at_reloco.com.ar>
Date: 2004-04-06 02:11:03 CEST

>You're also not following the convention of putting a space before a (.
>This is flexible, but this file appears to be consistent in this case.
>So you should follow what's being used in that file.
>
>

Here it is again.

Index: subversion/libsvn_subr/time.c
===================================================================
--- subversion/libsvn_subr/time.c (revision 9289)
+++ subversion/libsvn_subr/time.c (working copy)
@@ -24,6 +24,7 @@
 #include <apr_time.h>
 #include <apr_strings.h>
 #include "svn_time.h"
+#include "svn_utf.h"
 
 
 
@@ -226,7 +227,7 @@
   apr_time_exp_t exploded_time;
   apr_size_t len, retlen;
   apr_status_t ret;
- char *datestr, *curptr;
+ char *datestr, *curptr, human_datestr[SVN_TIME__MAX_LENGTH];
 
   /* Get the time into parts */
   apr_time_exp_lt (&exploded_time, when);
@@ -255,7 +256,7 @@
   curptr = datestr + len;
 
   /* Put in human explanatory part */
- ret = apr_strftime (curptr,
+ ret = apr_strftime (human_datestr,
                       &retlen,
                       SVN_TIME__MAX_LENGTH - len,
                       human_timestamp_format_suffix,
@@ -264,7 +265,21 @@
   /* If there was an error, ensure that the string is zero-terminated. */
   if (ret || retlen == 0)
     *curptr = '\0';
+ else
+ {
+ const char *utf8_string;
+ svn_error_t *err;
 
+ err = svn_utf_cstring_to_utf8 (&utf8_string, human_datestr, pool);
+ if (err)
+ {
+ *curptr = '\0';
+ svn_error_clear (err);
+ }
+ else
+ apr_cpystrn (curptr, utf8_string, SVN_TIME__MAX_LENGTH - len);
+ }
+
   return datestr;
 }
 

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Apr 6 02:11:19 2004

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.