version 1.19 | | version 1.20 |
---|
| | |
free(context); | | free(context); |
} | | } |
| | |
static int do_script(CFPContext* context) | | static int do_script(CFPContext* context,int silent) |
{ | | { |
FILE* scriptfile; | | FILE* scriptfile; |
PyObject* built; | | PyObject* built; |
| | |
scriptfile = fopen(context->script,"r"); | | scriptfile = fopen(context->script,"r"); |
if (scriptfile == NULL) | | if (scriptfile == NULL) |
{ | | { |
| | if (!silent) |
printf( "cfpython - The Script file %s can't be opened\n",context->script); | | printf( "cfpython - The Script file %s can't be opened\n",context->script); |
return 0; | | return 0; |
} | | } |
| | |
snprintf(context->options, sizeof(context->options), "%s", params); | | snprintf(context->options, sizeof(context->options), "%s", params); |
context->returnvalue = 1; /* Default is "command successful" */ | | context->returnvalue = 1; /* Default is "command successful" */ |
| | |
if (!do_script(context)) | | if (!do_script(context,0)) |
{ | | { |
freeContext(context); | | freeContext(context); |
return rv; | | return rv; |
| | |
va_end(args); | | va_end(args); |
context->returnvalue = 0; | | context->returnvalue = 0; |
| | |
if (!do_script(context)) | | if (!do_script(context,1)) |
{ | | { |
freeContext(context); | | freeContext(context); |
return &rv; | | return &rv; |
| | |
| | |
va_end(args); | | va_end(args); |
| | |
if (!do_script(context)) | | if (!do_script(context,0)) |
{ | | { |
freeContext(context); | | freeContext(context); |
return &rv; | | return &rv; |