Warning of -volid which are not ECMA 119 compliant
This commit is contained in:
parent
d4b5098636
commit
b0d28ab18d
@ -8271,23 +8271,32 @@ int Xorriso_option_version(struct XorrisO *xorriso, int flag)
|
||||
/* Option -volid */
|
||||
int Xorriso_option_volid(struct XorrisO *xorriso, char *volid, int flag)
|
||||
{
|
||||
int warn= 0, i, ret;
|
||||
static char good_chars[]= {
|
||||
int warn_shell= 0, warn_ecma= 0, i, ret;
|
||||
static char shell_chars[]= {
|
||||
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_-+=:.,~@"};
|
||||
static char ecma_chars[]= {"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_"};
|
||||
|
||||
for(i=0; volid[i]!=0; i++)
|
||||
if(strchr(good_chars, volid[i])==NULL)
|
||||
warn= 1;
|
||||
for(i=0; volid[i]!=0; i++) {
|
||||
if(strchr(shell_chars, volid[i])==NULL)
|
||||
warn_shell= 1;
|
||||
if(strchr(ecma_chars, volid[i])==NULL)
|
||||
warn_ecma= 1;
|
||||
}
|
||||
if(i>32) {
|
||||
sprintf(xorriso->info_text, "-volid: Text too long (%d > 32)", i);
|
||||
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
|
||||
return(0);
|
||||
}
|
||||
if(warn) {
|
||||
if(warn_shell) {
|
||||
sprintf(xorriso->info_text,
|
||||
"-volid text problematic as automatic mount point name");
|
||||
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "WARNING", 0);
|
||||
}
|
||||
if(warn_ecma) {
|
||||
sprintf(xorriso->info_text,
|
||||
"-volid text does not comply to ISO 9660 / ECMA 119 rules");
|
||||
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "WARNING", 0);
|
||||
}
|
||||
strcpy(xorriso->volid, volid);
|
||||
ret= Xorriso_set_volid(xorriso, volid, 0);
|
||||
if(ret<=0)
|
||||
|
@ -1 +1 @@
|
||||
#define Xorriso_timestamP "2008.02.08.175152"
|
||||
#define Xorriso_timestamP "2008.02.08.195627"
|
||||
|
Loading…
Reference in New Issue
Block a user