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

Re: [PATCH] Follow-up to r18536 OS400/EBCDIC Port: Convert string args to EBCDIC for functions that require it.

From: Julian Foad <julianfoad_at_btopenworld.com>
Date: 2006-03-25 01:05:27 CET

Paul Burba wrote:
>
> Index: subversion/libsvn_subr/io.c
> ===================================================================
> --- subversion/libsvn_subr/io.c (revision 19012)
> +++ subversion/libsvn_subr/io.c (working copy)
> @@ -54,6 +54,7 @@
>
> #ifdef AS400
> #define SVN_UTF_UTOE_XLATE_HANDLE "svn-utf-utoe-xlate-handle"
> +#define SVN_UTF_ETOU_XLATE_HANDLE "svn-utf-etou-xlate-handle"
> #endif
>
> /*
> @@ -432,9 +433,22 @@
> const char *unique_name_apr;
> const char *dest_apr;
> int rv;
> +#ifdef AS400_UTF8
> + const char *dest_apr_ebcdic;
> +#endif
>
> SVN_ERR(svn_path_cstring_from_utf8(&dest_apr, dest, pool));
>
> +#ifdef AS400_UTF8
> + /* On OS400 with UTF support a native cstring is UTF-8, but
> + * symlink() *really* needs EBCDIC paths. */
> + SVN_ERR(svn_utf_cstring_from_utf8_ex(&dest_apr_ebcdic, dest_apr,
> + (const char*)0,
> + SVN_UTF_UTOE_XLATE_HANDLE,
> + pool));
> + dest_apr = dest_apr_ebcdic;
> +#endif
> +
> for (i = 1; i <= 99999; i++)
> {
> apr_status_t apr_err;
> @@ -531,6 +545,9 @@
> const char *path_apr;
> char buf[1025];
> int rv;
> +#ifdef AS400_UTF8
> + const char *buf_utf8;
> +#endif
>
> #ifndef AS400_UTF8
> SVN_ERR(svn_path_cstring_from_utf8(&path_apr, path, pool));
> @@ -554,8 +571,17 @@
> dest_apr.len = rv;
>
> /* ### Cast needed, one of these interfaces is wrong */
> +#ifndef AS400_UTF8
> + /* ### Cast needed, one of these interfaces is wrong */

I assume you didn't mean to duplicate that comment.

> SVN_ERR(svn_utf_string_to_utf8((const svn_string_t **)dest, &dest_apr,
> pool));
> +#else
> + /* The buf filled by readlink() is ebcdic encoded
> + * despite V5R4's UTF support. */
> + SVN_ERR(svn_utf_cstring_to_utf8_ex(&buf_utf8, dest_apr.data,
> + (const char *)0, NULL, pool));

I think you meant to use that new constant you defined above, instead of NULL
here. (Probably thinking about that other patch that might make the arg
redundant...)

> + *dest = svn_string_create(buf_utf8, pool);
> +#endif
>
> return SVN_NO_ERROR;
> #else

- Julian

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Mar 25 01:05:49 2006

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.