Sat Jan 3 20:11:04 2009 UTC ()
reset args. Add casetrans


(christos)
diff -r1.28 -r1.29 src/sbin/mount_cd9660/mount_cd9660.c

cvs diff -r1.28 -r1.29 src/sbin/mount_cd9660/mount_cd9660.c (expand / switch to unified diff)

--- src/sbin/mount_cd9660/mount_cd9660.c 2008/08/05 20:57:45 1.28
+++ src/sbin/mount_cd9660/mount_cd9660.c 2009/01/03 20:11:04 1.29
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: mount_cd9660.c,v 1.28 2008/08/05 20:57:45 pooka Exp $ */ 1/* $NetBSD: mount_cd9660.c,v 1.29 2009/01/03 20:11:04 christos Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1992, 1993, 1994 4 * Copyright (c) 1992, 1993, 1994
5 * The Regents of the University of California. All rights reserved. 5 * The Regents of the University of California. All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to Berkeley 7 * This code is derived from software contributed to Berkeley
8 * by Pace Willisson (pace@blitz.com). The Rock Ridge Extension 8 * by Pace Willisson (pace@blitz.com). The Rock Ridge Extension
9 * Support code is derived from software contributed to Berkeley 9 * Support code is derived from software contributed to Berkeley
10 * by Atsushi Murai (amurai@spec.co.jp). 10 * by Atsushi Murai (amurai@spec.co.jp).
11 * 11 *
12 * Redistribution and use in source and binary forms, with or without 12 * Redistribution and use in source and binary forms, with or without
13 * modification, are permitted provided that the following conditions 13 * modification, are permitted provided that the following conditions
14 * are met: 14 * are met:
@@ -36,27 +36,27 @@ @@ -36,27 +36,27 @@
36 * @(#)mount_cd9660.c 8.7 (Berkeley) 5/1/95 36 * @(#)mount_cd9660.c 8.7 (Berkeley) 5/1/95
37 */ 37 */
38 38
39#include <sys/cdefs.h> 39#include <sys/cdefs.h>
40#ifndef lint 40#ifndef lint
41__COPYRIGHT("@(#) Copyright (c) 1992, 1993, 1994\ 41__COPYRIGHT("@(#) Copyright (c) 1992, 1993, 1994\
42 The Regents of the University of California. All rights reserved."); 42 The Regents of the University of California. All rights reserved.");
43#endif /* not lint */ 43#endif /* not lint */
44 44
45#ifndef lint 45#ifndef lint
46#if 0 46#if 0
47static char sccsid[] = "@(#)mount_cd9660.c 8.7 (Berkeley) 5/1/95"; 47static char sccsid[] = "@(#)mount_cd9660.c 8.7 (Berkeley) 5/1/95";
48#else 48#else
49__RCSID("$NetBSD: mount_cd9660.c,v 1.28 2008/08/05 20:57:45 pooka Exp $"); 49__RCSID("$NetBSD: mount_cd9660.c,v 1.29 2009/01/03 20:11:04 christos Exp $");
50#endif 50#endif
51#endif /* not lint */ 51#endif /* not lint */
52 52
53#include <sys/param.h> 53#include <sys/param.h>
54#include <sys/mount.h> 54#include <sys/mount.h>
55 55
56#include <err.h> 56#include <err.h>
57#include <stdlib.h> 57#include <stdlib.h>
58#include <stdio.h> 58#include <stdio.h>
59#include <string.h> 59#include <string.h>
60#include <unistd.h> 60#include <unistd.h>
61#include <util.h> 61#include <util.h>
62 62
@@ -64,26 +64,27 @@ __RCSID("$NetBSD: mount_cd9660.c,v 1.28  @@ -64,26 +64,27 @@ __RCSID("$NetBSD: mount_cd9660.c,v 1.28
64 64
65#include <mntopts.h> 65#include <mntopts.h>
66 66
67#include "mountprog.h" 67#include "mountprog.h"
68#include "mount_cd9660.h" 68#include "mount_cd9660.h"
69 69
70static const struct mntopt mopts[] = { 70static const struct mntopt mopts[] = {
71 MOPT_STDOPTS, 71 MOPT_STDOPTS,
72 MOPT_UPDATE, 72 MOPT_UPDATE,
73 MOPT_GETARGS, 73 MOPT_GETARGS,
74 { "extatt", 0, ISOFSMNT_EXTATT, 1 }, 74 { "extatt", 0, ISOFSMNT_EXTATT, 1 },
75 { "gens", 0, ISOFSMNT_GENS, 1 }, 75 { "gens", 0, ISOFSMNT_GENS, 1 },
76 { "maplcase", 1, ISOFSMNT_NOCASETRANS, 1 }, 76 { "maplcase", 1, ISOFSMNT_NOCASETRANS, 1 },
 77 { "casetrans", 1, ISOFSMNT_NOCASETRANS, 1 },
77 { "nrr", 0, ISOFSMNT_NORRIP, 1 }, 78 { "nrr", 0, ISOFSMNT_NORRIP, 1 },
78 { "rrip", 1, ISOFSMNT_NORRIP, 1 }, 79 { "rrip", 1, ISOFSMNT_NORRIP, 1 },
79 { "joliet", 1, ISOFSMNT_NOJOLIET, 1 }, 80 { "joliet", 1, ISOFSMNT_NOJOLIET, 1 },
80 { "rrcaseins", 0, ISOFSMNT_RRCASEINS, 1 }, 81 { "rrcaseins", 0, ISOFSMNT_RRCASEINS, 1 },
81 MOPT_NULL, 82 MOPT_NULL,
82}; 83};
83 84
84static void usage(void); 85static void usage(void);
85 86
86#ifndef MOUNT_NOMAIN 87#ifndef MOUNT_NOMAIN
87int 88int
88main(int argc, char **argv) 89main(int argc, char **argv)
89{ 90{
@@ -92,28 +93,29 @@ main(int argc, char **argv) @@ -92,28 +93,29 @@ main(int argc, char **argv)
92 return mount_cd9660(argc, argv); 93 return mount_cd9660(argc, argv);
93} 94}
94#endif 95#endif
95 96
96void 97void
97mount_cd9660_parseargs(int argc, char **argv, 98mount_cd9660_parseargs(int argc, char **argv,
98 struct iso_args *args, int *mntflags, 99 struct iso_args *args, int *mntflags,
99 char *canon_dev, char *canon_dir) 100 char *canon_dev, char *canon_dir)
100{ 101{
101 int ch, opts; 102 int ch, opts;
102 mntoptparse_t mp; 103 mntoptparse_t mp;
103 char *dev, *dir; 104 char *dev, *dir;
104 105
105 *mntflags = opts = 0; 
106 memset(args, 0, sizeof(*args)); 106 memset(args, 0, sizeof(*args));
 107 *mntflags = opts = 0;
 108 optind = optreset = 1;
107 while ((ch = getopt(argc, argv, "egijo:r")) != -1) 109 while ((ch = getopt(argc, argv, "egijo:r")) != -1)
108 switch (ch) { 110 switch (ch) {
109 case 'e': 111 case 'e':
110 /* obsolete, retained for compatibility only, use 112 /* obsolete, retained for compatibility only, use
111 * -o extatt */ 113 * -o extatt */
112 opts |= ISOFSMNT_EXTATT; 114 opts |= ISOFSMNT_EXTATT;
113 break; 115 break;
114 case 'g': 116 case 'g':
115 /* obsolete, retained for compatibility only, use 117 /* obsolete, retained for compatibility only, use
116 * -o gens */ 118 * -o gens */
117 opts |= ISOFSMNT_GENS; 119 opts |= ISOFSMNT_GENS;
118 break; 120 break;
119 case 'j': 121 case 'j':