summaryrefslogtreecommitdiffstats
path: root/sys/fs/msdosfs/msdosfs_conv.c
diff options
context:
space:
mode:
authormsmith <msmith@FreeBSD.org>1998-02-26 06:45:46 +0000
committermsmith <msmith@FreeBSD.org>1998-02-26 06:45:46 +0000
commit4abe3410e6b7490667772d899fd8b5f41416c487 (patch)
treee46a6730f5f210b692d0353ccc3fda2be11d7531 /sys/fs/msdosfs/msdosfs_conv.c
parent15e6194107ac825d2decda9954710a2fbbbe591d (diff)
downloadFreeBSD-src-4abe3410e6b7490667772d899fd8b5f41416c487.zip
FreeBSD-src-4abe3410e6b7490667772d899fd8b5f41416c487.tar.gz
Fixes for some bugs in the VFAT/FAT32 support:
- 'mv longnamedfile1 longnamedfile2' would cause longnamedfile2 to lose its long name. - Long names have trailing spaces/dots stripped for lookup as well as assignment. - A lockup when the mdsosfs was accessed from within the Linux emulator is fixed. - A bug whereby long filenames were recognised by Microsoft operating systems but not FreeBSD is fixed. Submitted by: Dmitrij Tejblum <dima@tejblum.dnttm.rssi.ru>
Diffstat (limited to 'sys/fs/msdosfs/msdosfs_conv.c')
-rw-r--r--sys/fs/msdosfs/msdosfs_conv.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/sys/fs/msdosfs/msdosfs_conv.c b/sys/fs/msdosfs/msdosfs_conv.c
index 8812a5e..ca3bdb6 100644
--- a/sys/fs/msdosfs/msdosfs_conv.c
+++ b/sys/fs/msdosfs/msdosfs_conv.c
@@ -1,4 +1,4 @@
-/* $Id: msdosfs_conv.c,v 1.22 1998/02/23 16:44:27 ache Exp $ */
+/* $Id: msdosfs_conv.c,v 1.23 1998/02/24 14:13:11 ache Exp $ */
/* $NetBSD: msdosfs_conv.c,v 1.25 1997/11/17 15:36:40 ws Exp $ */
/*-
@@ -995,10 +995,22 @@ winSlotCnt(un, unlen)
const u_char *un;
int unlen;
{
- for (un += unlen; unlen > 0; unlen--)
- if (*--un != ' ' && *un != '.')
- break;
+ unlen = winLenFixup(un, unlen);
if (unlen > WIN_MAXLEN)
return 0;
return howmany(unlen, WIN_CHARS);
}
+
+/*
+ * Determine the number of bytes neccesary for Win95 names
+ */
+int
+winLenFixup(un, unlen)
+ const u_char* un;
+ int unlen;
+{
+ for (un += unlen; unlen > 0; unlen--)
+ if (*--un != ' ' && *un != '.')
+ break;
+ return unlen;
+}
OpenPOWER on IntegriCloud