Skip to content

Instantly share code, notes, and snippets.

@knight-ryu12
Last active September 24, 2019 09:33
Show Gist options
  • Save knight-ryu12/ff44ad88caec0c26a7c60bea013aeac0 to your computer and use it in GitHub Desktop.
Save knight-ryu12/ff44ad88caec0c26a7c60bea013aeac0 to your computer and use it in GitHub Desktop.
else if (!strncmp(opt,"-use-the-force-luke",19))
{ char *s=strchr (opt,'='),*o;
if (s == NULL) /* backward compatibility */
no_tty_check = 1;
else
{ s++;
if (strstr(s,"tty")) no_tty_check = 1;
if (strstr(s,"dummy")) test_write = 1;
if (strstr(s,"notray")) no_reload = 1;
if (strstr(s,"noload")) no_reload = -1;
if (strstr(s,"wrvfy")) wrvfy = 1;
if (strstr(s,"4gms")) no_4gb_check = 1;
if (strstr(s,"noopc")) no_opc = 1;
if (strstr(s,"moi"))
{ quiet=-1; mkisofs_argv[mkisofs_argc++] = "-quiet"; }
if ((o=strstr(s,"dao")))
{ dvd_compat += 256;
/* vvvvvvvvvvv tracksize option takes precedence! */
if (dao_size==0 && (o[3]==':' || o[3]=='='))
{ dao_size=strtol(o+4,0,0);
if (dao_size<=0)
fprintf (stderr,":-( insane dao%c%d option\n",
o[3],dao_size),
exit(FATAL_START(EINVAL));
}
}
if ((o=strstr(s,"tracksize")))
{ if (o[9]==':' || o[9]=='=')
{ dao_size=strtol(o+10,0,0);
if (dao_size<=0)
fprintf (stderr,":-( insane tracksize%c%d option\n",
o[9],dao_size),
exit(FATAL_START(EINVAL));
}
}
if ((o=strstr(s,"break")))
{ if (o[5]==':' || o[5]=='=')
{ layer_break=strtol(o+6,0,0);
if (layer_break<=0 || layer_break%16)
fprintf (stderr,":-( insane break%c%d option\n",
o[5],layer_break),
exit(FATAL_START(EINVAL));
}
}
if ((o=strstr(s,"seek")) && next_session<0)
{ if (o[4]==':' || o[4]=='=')
{ next_session=strtol(o+5,0,0);
if (next_session<0 || next_session%16)
fprintf (stderr,":-( insane seek%c%d option\n",
o[4],next_session),
exit(FATAL_START(EINVAL));
}
}
if ((o=strstr(s,"bufsize")))
{ if (o[7]==':' || o[7]=='=')
{ the_buffer_size=strtol(o+8,&o,0);
if (*o=='M' || *o=='m')
the_buffer_size*=1024*1024;
else if (*o=='K' || *o=='k')
the_buffer_size*=1024;
}
}
if ((o=strstr(s,"spare")))
{ spare=1;
if (o[5]==':' || o[5]=='=')
{ if (!strncmp(o+6,"none",4)) spare=-1;
else if (!strncmp(o+6,"min",3)) spare=0;
}
}
}
continue;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment