summaryrefslogtreecommitdiff
path: root/perl.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2011-11-24 21:28:27 +0100
committerNicholas Clark <nick@ccl4.org>2011-12-04 13:01:52 +0100
commitb6f82619da63473c236f7d338cafcc1bfd4bafe3 (patch)
tree39ec9b2e7fbf818aa3239fcd237c0ba49039ad16 /perl.c
parent08ad9465eddc2d08165efd8d3767520c6897b2fe (diff)
downloadperl-b6f82619da63473c236f7d338cafcc1bfd4bafe3.tar.gz
Refactor S_usage() to take 0 parameters and exit directly().
This simplifies the code, as it's only called from one spot, in Perl_moreswitches().
Diffstat (limited to 'perl.c')
-rw-r--r--perl.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/perl.c b/perl.c
index fe69e8ccb9..b4a254457d 100644
--- a/perl.c
+++ b/perl.c
@@ -2912,7 +2912,7 @@ Perl_require_pv(pTHX_ const char *pv)
}
STATIC void
-S_usage(pTHX_ const char *name) /* XXX move this out into a module ? */
+S_usage(pTHX) /* XXX move this out into a module ? */
{
/* This message really ought to be max 23 lines.
* Removed -h because the user already knows that option. Others? */
@@ -2955,13 +2955,12 @@ NULL
const char * const *p = usage_msg;
PerlIO *out = PerlIO_stdout();
- PERL_ARGS_ASSERT_USAGE;
-
PerlIO_printf(out,
"\nUsage: %s [switches] [--] [programfile] [arguments]\n",
- name);
+ PL_origargv[0]);
while (*p)
PerlIO_puts(out, *p++);
+ my_exit(0);
}
/* convert a string of -D options (or digits) into an int.
@@ -3168,8 +3167,7 @@ Perl_moreswitches(pTHX_ const char *s)
return s;
}
case 'h':
- usage(PL_origargv[0]);
- my_exit(0);
+ usage();
case 'i':
Safefree(PL_inplace);
#if defined(__CYGWIN__) /* do backup extension automagically */