updated libopts to 5.18

This commit is contained in:
Nikos Mavrogiannopoulos
2013-11-05 21:04:56 +01:00
parent 6cfa963a1b
commit e7e29b8396
34 changed files with 1152 additions and 926 deletions

View File

@@ -30,13 +30,6 @@
* 13aa749a5b0a454917a944ed8fffc530b784f5ead522b1aacaf4ec8aa55a6239 COPYING.mbsd
*/
tOptions * optionParseShellOptions = NULL;
static char const * shell_prog = NULL;
static char * script_leader = NULL;
static char * script_trailer = NULL;
static char * script_text = NULL;
/* = = = START-STATIC-FORWARD = = = */
static void
emit_var_text(char const * prog, char const * var, int fdin);
@@ -75,6 +68,21 @@ static void
open_out(char const * fname, char const * pname);
/* = = = END-STATIC-FORWARD = = = */
LOCAL void
option_exits(int exit_code)
{
if (print_exit)
printf("\nexit %d\n", exit_code);
exit(exit_code);
}
LOCAL void
ao_bug(char const * msg)
{
fprintf(stderr, zao_bug_msg, msg);
option_exits(EX_SOFTWARE);
}
LOCAL void
fserr_warn(char const * prog, char const * op, char const * fname)
{
@@ -86,7 +94,7 @@ LOCAL void
fserr_exit(char const * prog, char const * op, char const * fname)
{
fserr_warn(prog, op, fname);
exit(EXIT_FAILURE);
option_exits(EXIT_FAILURE);
}
/*=export_func optionParseShell
@@ -325,7 +333,7 @@ text_to_var(tOptions * opts, teTextTo which, tOptDesc * od)
/* NOTREACHED */
default:
exit(EXIT_FAILURE);
option_exits(EXIT_FAILURE);
/* NOTREACHED */
}
/* NOTREACHED */
@@ -862,7 +870,7 @@ genshelloptUsage(tOptions * opts, int exit_cd)
fflush(stderr);
fflush(stdout);
if (ferror(stdout) || ferror(stderr))
exit(EXIT_FAILURE);
option_exits(EXIT_FAILURE);
option_usage_fp = stdout;
@@ -929,7 +937,7 @@ genshelloptUsage(tOptions * opts, int exit_cd)
if (ferror(stdout))
fserr_exit(opts->pzProgName, zwriting, zstdout_name);
exit(EXIT_SUCCESS);
option_exits(EXIT_SUCCESS);
#endif
}