NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: PR/44523 CVS commit: src/sys/fs/hfs
The following reply was made to PR kern/44523; it has been noted by GNATS.
From: David Holland <dholland-bugs%netbsd.org@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc:
Subject: Re: PR/44523 CVS commit: src/sys/fs/hfs
Date: Sat, 12 Feb 2011 20:41:54 +0000
On Thu, Feb 10, 2011 at 04:50:05AM +0000, Taylor R Campbell wrote:
> All fixed, thanks!
>
> Works now. Thanks!
Here's a patch for -5 (it doesn't merge cleanly) - I don't have the
materials to test this, so it would be helpful if someone else
could...
Index: hfs_vnops.c
===================================================================
RCS file: /cvsroot/src/sys/fs/hfs/hfs_vnops.c,v
retrieving revision 1.11
diff -u -p -r1.11 hfs_vnops.c
--- hfs_vnops.c 3 Sep 2008 22:57:46 -0000 1.11
+++ hfs_vnops.c 12 Feb 2011 20:40:30 -0000
@@ -398,7 +398,7 @@ hfs_vop_lookup(void *v)
*vpp = vdp;
} else {
hfs_callback_args cbargs;
- uint8_t len;
+ uint8_t len, ni;
hfslib_init_cbargs(&cbargs);
@@ -407,6 +407,9 @@ hfs_vop_lookup(void *v)
unicn = malloc(cnp->cn_namelen*sizeof(unicn[0]), M_TEMP,
M_WAITOK);
len = utf8_to_utf16(unicn, cnp->cn_namelen,
cnp->cn_nameptr, cnp->cn_namelen, 0, NULL);
+ for (ni = 0; ni < len; ni++)
+ if (unicn[ni] == (unichar_t)':')
+ unicn[ni] = (unichar_t)'/';
/* XXX: check conversion errors? */
if (hfslib_make_catalog_key(VTOH(vdp)->h_rec.u.cnid, len, unicn,
&key) == 0) {
@@ -861,7 +864,7 @@ struct vop_readdir_args /* {
off_t bufoff; /* current position in buffer relative to start of
dirents */
uint32_t numchildren;
uint32_t curchild; /* index of child we're currently stuffing into
dirent */
- size_t namlen;
+ size_t namlen, ni;
int error;
int i; /* dummy variable */
@@ -906,6 +909,9 @@ struct vop_readdir_args /* {
/* XXX: how to handle name too long? */
continue;
}
+ for (ni = 0; ni < namlen; ni++)
+ if (curent.d_name[ni] == '/')
+ curent.d_name[ni] = ':';
curent.d_namlen = namlen;
curent.d_reclen = _DIRENT_SIZE(&curent);
--
David A. Holland
dholland%netbsd.org@localhost
Home |
Main Index |
Thread Index |
Old Index