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

Re: [PATCH] #1 Update on port to OS400/EBCDIC

From: Philip Martin <philip_at_codematters.co.uk>
Date: 2006-02-10 00:05:57 CET

Paul Burba <paulb@softlanding.com> writes:

> --- subversion/svn/main.c (revision 18362)
> +++ subversion/svn/main.c (working copy)
> @@ -48,6 +48,9 @@
>
> #include "svn_private_config.h"
>
> +#if AS400_UTF8
> +#define SVN_UTF_ETOU_XLATE_HANDLE "svn-utf-etou-xlate-handle"
> +#endif
>
> /*** Option Processing ***/
>
> @@ -780,6 +783,11 @@
> svn_cl__cmd_baton_t command_baton;
> svn_auth_baton_t *ab;
> svn_config_t *cfg;
> +#if AS400_UTF8
> + /* Even when compiled with UTF support in V5R4, argv is still
> + * encoded in ebcdic, so we'll need to convert it to utf-8. */
> + const char ** argv_utf8;
> +#endif
>
> /* Initialize the app. */
> if (svn_cmdline_init ("svn", stderr) != EXIT_SUCCESS)
> @@ -831,7 +839,20 @@
> }
>
> /* Else, parse options. */
> +#if !AS400_UTF8
> apr_getopt_init (&os, pool, argc, argv);
> +#else
> + /* Convert argv to utf-8 for call to apr_getopt_init(). */
> + argv_utf8 = apr_palloc (pool, sizeof(char *) * argc);
> + for (i = 0; i < argc; i++)
> + {
> + /* Use "0" for default job ccsid. */
> + if (svn_utf_cstring_to_utf8_ex (&argv_utf8[i], argv[i], "0",
> + SVN_UTF_ETOU_XLATE_HANDLE, pool))
> + return EXIT_FAILURE;
> + }
> + apr_getopt_init (&os, pool, argc, argv_utf8);
> +#endif
> os->interleave = 1;
> while (1)
> {

Lets try and keep that conditional code in one place, rather than in
every main faunction. How about a function svn_getopt_int that does
all that on EBCDIC platforms and just calls apr_getopt_init on the
others? Put it in libsvn_subr/cmdline.c perhaps?

-- 
Philip Martin
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Feb 10 00:06:36 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.