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

Re: Porting Subversion to EBCDIC

From: Julian Foad <julianfoad_at_btopenworld.com>
Date: 2005-02-11 00:42:16 CET

Mark Phippard wrote:
> In writing a reply to Julian about our use of escape characters in our
> EBCDIC port, it seemed like a good time to offer up a more detailed
> explanation of what we are doing and where we are.

Thanks. This will be very interesting.

> You can download our current patch against the 1.1.x branch here:
>
> http://support.softlanding.com/ebcdic.diff

While looking at your patch, I couldn't help reviewing it a bit...

> Index: include/svn_path.h
> ===================================================================
[...]
> +/** Same as svn_path_basename but operates on ebcdic encoded @a path
> + */
> +char *svn_path_join_ebcdic (const char *base,
> + const char *component,
> + apr_pool_t *pool);

Should the comment say "Same as svn_path_join" instead of "svn_path_basename"?

> Index: libsvn_subr/io.c
> ===================================================================
[...]
> @@ -1968,7 +2088,8 @@
> return SVN_NO_ERROR;
>
> err = file_name_get (&name, file, pool);
> - name = (! err && name) ? apr_psprintf (pool, "file '%s'", name) : "stream";
> + name = (! err && name) ? apr_psprintf (pool, FILE_STR SVN_UTF8_SPACE_STR
> + "\x27%s\x27", name) : STREAM_STR;
> svn_error_clear (err);
>
> return svn_error_wrap_apr (status, "Can't %s %s", op, name);

Here you are passing a native format-string ("Can't %s %s") but UTF8 arguments
("name", at least) to svn_error_wrap_apr.

> Index: libsvn_ra_local/split_url.c
> ===================================================================
[...]
> @@ -38,7 +54,7 @@
> /* Verify that the URL is well-formed (loosely) */
>
> /* First, check for the "file://" prefix. */
> - if (strncmp (URL, "file://", 7) != 0)
> + if (strncmp (URL, FILE_PREFIX_STR, 7) != 0)
> return svn_error_createf
> (SVN_ERR_RA_ILLEGAL_URL, NULL,
> _("Local URL '%s' does not contain 'file://' prefix"), URL);

Same here, I think, and in many other error messages with arguments.

> Index: mod_dav_svn/log.c
> ===================================================================
[...]
> if (msg)
> +#if APR_CHARSET_EBCDIC
> + SVN_ERR (svn_utf_utfcstring_from_utf8(&msg, msg, pool));
> +#endif
> SVN_ERR( send_xml(lrb, "<D:comment>%s</D:comment>" DEBUG_CR,
> apr_xml_quote_string(pool, msg, 0)) );

It looks like you need braces around those two SVN_ERR statements to keep them
both under the "if".

I haven't reviewed carefully. I just noticed these while flicking through it.

- Julian

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Feb 11 00:43:34 2005

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.