diff options
author | ache <ache@FreeBSD.org> | 1998-02-23 09:41:02 +0000 |
---|---|---|
committer | ache <ache@FreeBSD.org> | 1998-02-23 09:41:02 +0000 |
commit | 03cc3500d921c5f53224de43b28ecc50c59f21e3 (patch) | |
tree | e519a90dcb08f38467294209ddf8d581a144f50a /sbin/mount_msdosfs | |
parent | 5722f302dc8dc00ef8dd862807a8a4881cbbb694 (diff) | |
download | FreeBSD-src-03cc3500d921c5f53224de43b28ecc50c59f21e3.zip FreeBSD-src-03cc3500d921c5f53224de43b28ecc50c59f21e3.tar.gz |
Implement loadable upper->lower local conversion table
Recently introduced -w renamed to -W
Diffstat (limited to 'sbin/mount_msdosfs')
-rw-r--r-- | sbin/mount_msdosfs/mount_msdosfs.8 | 10 | ||||
-rw-r--r-- | sbin/mount_msdosfs/mount_msdosfs.c | 27 |
2 files changed, 30 insertions, 7 deletions
diff --git a/sbin/mount_msdosfs/mount_msdosfs.8 b/sbin/mount_msdosfs/mount_msdosfs.8 index 97dad8c..dc36d99 100644 --- a/sbin/mount_msdosfs/mount_msdosfs.8 +++ b/sbin/mount_msdosfs/mount_msdosfs.8 @@ -28,7 +28,7 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.\" $Id: mount_msdos.8,v 1.7 1998/02/18 09:30:28 jkh Exp $ +.\" $Id: mount_msdos.8,v 1.8 1998/02/22 15:28:00 ache Exp $ .\" .Dd April 7, 1994 .Dt MOUNT_MSDOS 8 @@ -46,7 +46,8 @@ .Op Fl l .Op Fl 9 .\".Op Fl G -.Op Fl w Ar table +.Op Fl L Ar locale +.Op Fl W Ar table .Pa special .Pa node .Sh DESCRIPTION @@ -128,7 +129,10 @@ if deleting or renaming a file. This forces .\"filesystem. The differences to the msdos filesystem are minimal and .\"limited to the boot block. This option enforces .\".Fl s . -.It Fl w Ar table +.It Fl L Ar locale +Specify locale name used for internal uppercase to lowercase conversion +for DOS and Win'95 names. +.It Fl W Ar table Specify file with local character set to Unicode conversion table for Win'95 long names. This table is text file contains 128 Unicode codes corresponding to diff --git a/sbin/mount_msdosfs/mount_msdosfs.c b/sbin/mount_msdosfs/mount_msdosfs.c index b747c95..c65a2f9 100644 --- a/sbin/mount_msdosfs/mount_msdosfs.c +++ b/sbin/mount_msdosfs/mount_msdosfs.c @@ -32,7 +32,7 @@ #ifndef lint static const char rcsid[] = - "$Id: mount_msdos.c,v 1.11 1998/02/18 09:30:31 jkh Exp $"; + "$Id: mount_msdos.c,v 1.12 1998/02/22 15:28:06 ache Exp $"; #endif /* not lint */ #include <sys/param.h> @@ -44,6 +44,7 @@ static const char rcsid[] = #include <ctype.h> #include <err.h> #include <grp.h> +#include <locale.h> #include <pwd.h> #include <stdio.h> #include <stdlib.h> @@ -66,6 +67,7 @@ static uid_t a_uid __P((char *)); static mode_t a_mask __P((char *)); static void usage __P((void)) __dead2; static void load_u2wtable __P((u_int16_t *, char *)); +static void load_ultable __P((u_int8_t *, char *)); int main(argc, argv) @@ -82,7 +84,7 @@ main(argc, argv) (void)memset(&args, '\0', sizeof(args)); args.magic = MSDOSFS_ARGSMAGIC; - while ((c = getopt(argc, argv, "sl9u:g:m:o:w:")) != -1) { + while ((c = getopt(argc, argv, "sl9u:g:m:o:L:W:")) != -1) { switch (c) { #ifdef MSDOSFSMNT_GEMDOSFS case 'G': @@ -110,7 +112,11 @@ main(argc, argv) args.mask = a_mask(optarg); set_mask = 1; break; - case 'w': + case 'L': + load_ultable(args.ul, optarg); + args.flags |= MSDOSFSMNT_ULTABLE; + break; + case 'W': load_u2wtable(args.u2w, optarg); args.flags |= MSDOSFSMNT_U2WTABLE; break; @@ -234,7 +240,7 @@ a_mask(s) void usage() { - fprintf(stderr, "usage: mount_msdos [-o options] [-u user] [-g group] [-m mask] [-s] [-l] [-9] [-w table] bdev dir\n"); + fprintf(stderr, "usage: mount_msdos [-o options] [-u user] [-g group] [-m mask] [-s] [-l] [-9] [-L locale] [-W table] bdev dir\n"); exit(EX_USAGE); } @@ -264,3 +270,16 @@ load_u2wtable (table, name) } fclose(f); } + +void +load_ultable (table, name) + u_int8_t *table; + char *name; +{ + int i; + + if (setlocale(LC_CTYPE, name) == NULL) + err(EX_CONFIG, name); + for (i = 0; i < 128; i++) + table[i] = tolower(i | 0x80); +} |