Enabled xorrecord dev=-

This commit is contained in:
Thomas Schmitt 2011-10-18 16:22:16 +00:00
parent 622af5ca49
commit a62f6af50a
4 changed files with 48 additions and 7 deletions

View File

@ -29,6 +29,22 @@
#include "xorrisoburn.h" #include "xorrisoburn.h"
int Xorriso_cdrskin_uses_stdout(struct XorrisO *xorriso, int argc, char **argv,
int flag)
{
int i;
for(i= 0; i < argc; i++) {
if(strcmp(argv[i], "dev=-") == 0 ||
strcmp(argv[i], "dev=stdio:/dev/fd/1") == 0 ||
strcmp(argv[i], "-dev=-") == 0 ||
strcmp(argv[i], "-dev=stdio:/dev/fd/1") == 0)
return(1);
}
return(0);
}
int Xorriso_cdrskin_help(struct XorrisO *xorriso, int flag) int Xorriso_cdrskin_help(struct XorrisO *xorriso, int flag)
{ {
static char helptext[][80]= { static char helptext[][80]= {

View File

@ -18,6 +18,9 @@ int Xorriso_cdrskin(struct XorrisO *xorriso, char *whom, int argc, char **argv,
int Xorriso_cdrskin_help(struct XorrisO *xorriso, int flag); int Xorriso_cdrskin_help(struct XorrisO *xorriso, int flag);
int Xorriso_cdrskin_uses_stdout(struct XorrisO *xorriso, int argc, char **argv,
int flag);
int Xorriso_as_cdrskin(struct XorrisO *xorriso, int argc, char **argv, int Xorriso_as_cdrskin(struct XorrisO *xorriso, int argc, char **argv,
int *idx, int flag); int *idx, int flag);

View File

@ -1647,9 +1647,19 @@ int Xorriso_prescan_args(struct XorrisO *xorriso, int argc, char **argv,
ret= Xorriso_option_no_rc(xorriso, 0); ret= Xorriso_option_no_rc(xorriso, 0);
if(ret<=0) if(ret<=0)
error_seen= 1; error_seen= 1;
} else if(xorriso->argument_emulation >= 1 &&
xorriso->argument_emulation <= 2) {
{ret= 1; goto ex;} {ret= 1; goto ex;}
} else if(xorriso->argument_emulation == 1) { /* mkisofs emulation */
if(xorriso->dev_fd_1 < 0)
goto protect_stdout;
{ret= 1; goto ex;}
} else if(xorriso->argument_emulation == 2) { /* cdrecord emulation */
if(xorriso->dev_fd_1 < 0)
if(Xorriso_cdrskin_uses_stdout(xorriso, argc - 1 - (flag & 1),
argv + 1 + (flag & 1), 0))
goto protect_stdout;
{ret= 1; goto ex;}
} else if((strcmp(cmd,"dev")==0 || strcmp(cmd,"outdev")==0 || } else if((strcmp(cmd,"dev")==0 || strcmp(cmd,"outdev")==0 ||
strcmp(cmd,"indev")==0) && strcmp(cmd,"indev")==0) &&
(strcmp(arg1,"stdio:/dev/fd/1")==0 || strcmp(arg1,"-")==0) && (strcmp(arg1,"stdio:/dev/fd/1")==0 || strcmp(arg1,"-")==0) &&
@ -1670,6 +1680,8 @@ protect_stdout:;
sprintf(xorriso->info_text, "Disabling use of libreadline."); sprintf(xorriso->info_text, "Disabling use of libreadline.");
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "DEBUG", 0); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "DEBUG", 0);
} }
if(xorriso->argument_emulation >= 1 && xorriso->argument_emulation <=2)
{ret= 1; goto ex;}
} else if(strcmp(cmd,"abort_on")==0 && was_dashed == 1) { } else if(strcmp(cmd,"abort_on")==0 && was_dashed == 1) {
i++; i++;
@ -1693,12 +1705,22 @@ protect_stdout:;
} else if(strcmp(cmd,"as")==0 && was_dashed == 1) { } else if(strcmp(cmd,"as")==0 && was_dashed == 1) {
ret= Xorriso_count_args(xorriso, argc - i, argv + i, &arg_count, 1); ret= Xorriso_count_args(xorriso, argc - i, argv + i, &arg_count, 1);
if(ret == 1) if(ret == 1) {
i+= arg_count; i+= arg_count;
if(was_dashed == 1)
if(strcmp(arg1, "mkisofs")==0 || strcmp(arg1, "genisoimage")==0 || if((strcmp(arg1, "cdrecord")==0 || strcmp(arg1, "wodim")==0 ||
strcmp(arg1, "genisofs")==0 || strcmp(arg1, "xorrisofs")==0) strcmp(arg1, "cdrskin")==0 || strcmp(arg1, "xorrecord")==0) &&
xorriso->dev_fd_1 < 0)
if(Xorriso_cdrskin_uses_stdout(xorriso, arg_count - 1,
argv + i - arg_count + 2, 0))
goto protect_stdout; goto protect_stdout;
}
if(was_dashed == 1) {
if((strcmp(arg1, "mkisofs")==0 || strcmp(arg1, "genisoimage")==0 ||
strcmp(arg1, "genisofs")==0 || strcmp(arg1, "xorrisofs")==0) &&
xorriso->dev_fd_1 < 0)
goto protect_stdout;
}
} else if(strcmp(cmd, "list_delimiter") == 0) { } else if(strcmp(cmd, "list_delimiter") == 0) {
/* Needed for interpreting other args. Gets reset after prescan. */ /* Needed for interpreting other args. Gets reset after prescan. */

View File

@ -1 +1 @@
#define Xorriso_timestamP "2011.10.14.094257" #define Xorriso_timestamP "2011.10.18.162119"