lkml.org 
[lkml]   [2001]   [Jul]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] Linux 2.4.7-pre5 & vfat short file names & Windows 2000
Hello,

the patch below solves two problems.

1. Vfat upper case short names created under Linux, now are shown
also in upper case under Windows 2000.

2. Short names created under Windows 2000 like ABC.ABC ABC.abc and so on,
now are shown in correctly case under Linux.

The patch is also available at http://www.bszh.de/download/linux/

Best regards,
Wolfram

--
Wolfram Pienkoss Berufsschulzentrum Hermsdorf
Rodaer Strasse 45, D-07629 Hermsdorf Phone: +49-36601-47407
eMail: wp@bszh.de www: www.bszh.de Fax: +49-36601-47400

diff -urdN linux-2.4.7-pre5.orig/fs/fat/dir.c linux/fs/fat/dir.c
--- linux-2.4.7-pre5.orig/fs/fat/dir.c Wed Apr 18 11:49:12 2001
+++ linux/fs/fat/dir.c Tue Jul 10 15:51:43 2001
@@ -10,7 +10,7 @@
* VFAT extensions by Gordon Chaffee <chaffee@plateau.cs.berkeley.edu>
* Merged with msdos fs by Henrik Storner <storner@osiris.ping.dk>
* Rewritten for constant inumbers. Plugged buffer overrun in readdir(). AV
- * Short name translation 1999 by Wolfram Pienkoss <wp@bszh.de>
+ * Short name translation 1999-2001 by Wolfram Pienkoss <wp@bszh.de>
*/

#define ASC_LINUX_VERSION(V, P, S) (((V) * 65536) + ((P) * 256) + (S))
@@ -271,7 +271,7 @@
}
for (i = 0, j = 0, last_u = 0; i < 8;) {
if (!work[i]) break;
- if (nocase)
+ if (nocase && !(de->lcase & CASE_LOWER_BASE))
chl = fat_short2uni(nls_disk, &work[i], 8 - i, &bufuname[j++]);
else
chl = fat_short2lower_uni(nls_disk, &work[i], 8 - i, &bufuname[j++]);
@@ -287,7 +287,7 @@
fat_short2uni(nls_disk, ".", 1, &bufuname[j++]);
for (i = 0; i < 3;) {
if (!de->ext[i]) break;
- if (nocase)
+ if (nocase && !(de->lcase & CASE_LOWER_EXT))
chl = fat_short2uni(nls_disk, &de->ext[i], 3 - i, &bufuname[j++]);
else
chl = fat_short2lower_uni(nls_disk, &de->ext[i], 3 - i, &bufuname[j++]);
@@ -474,7 +474,7 @@
}
for (i = 0, j = 0, last = 0, last_u = 0; i < 8;) {
if (!(c = work[i])) break;
- if (nocase)
+ if (nocase && !(de->lcase & CASE_LOWER_BASE))
chl = fat_short2uni(nls_disk, &work[i], 8 - i, &bufuname[j++]);
else
chl = fat_short2lower_uni(nls_disk, &work[i], 8 - i, &bufuname[j++]);
@@ -498,7 +498,7 @@
ptname[i++] = '.';
for (i2 = 0; i2 < 3;) {
if (!(c = de->ext[i2])) break;
- if (nocase)
+ if (nocase && !(de->lcase & CASE_LOWER_EXT))
chl = fat_short2uni(nls_disk, &de->ext[i2], 3 - i2, &bufuname[j++]);
else
chl = fat_short2lower_uni(nls_disk, &de->ext[i2], 3 - i2, &bufuname[j++]);
diff -urdN linux-2.4.7-pre5.orig/fs/vfat/namei.c linux/fs/vfat/namei.c
--- linux-2.4.7-pre5.orig/fs/vfat/namei.c Fri Apr 6 10:51:19 2001
+++ linux/fs/vfat/namei.c Tue Jul 10 15:51:43 2001
@@ -9,7 +9,7 @@
* what file operation caused you trouble and if you can duplicate
* the problem, send a script that demonstrates it.
*
- * Short name translation 1999 by Wolfram Pienkoss <wp@bszh.de>
+ * Short name translation 1999-2001 by Wolfram Pienkoss <wp@bszh.de>
*
* Support Multibyte character and cleanup by
* OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
@@ -1056,7 +1056,7 @@
(*de)->starthi = 0;
(*de)->size = 0;
(*de)->attr = is_dir ? ATTR_DIR : ATTR_ARCH;
- (*de)->lcase = CASE_LOWER_BASE | CASE_LOWER_EXT;
+ (*de)->lcase = 0;


fat_mark_buffer_dirty(sb, *bh);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 12:56    [W:0.023 / U:2.844 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site