summaryrefslogtreecommitdiffstats
path: root/zdiff.cc
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2022-07-26 05:52:19 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2022-07-26 05:52:47 +0000
commit274c86b0397198011756479218dd14262d9421ff (patch)
tree47cd5cedf3cfcbba77d127200852a21d03502e7c /zdiff.cc
parentReleasing debian version 1.11-5. (diff)
downloadzutils-274c86b0397198011756479218dd14262d9421ff.tar.xz
zutils-274c86b0397198011756479218dd14262d9421ff.zip
Merging upstream version 1.12~pre2.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'zdiff.cc')
-rw-r--r--zdiff.cc25
1 files changed, 13 insertions, 12 deletions
diff --git a/zdiff.cc b/zdiff.cc
index a82f336..ba77b2a 100644
--- a/zdiff.cc
+++ b/zdiff.cc
@@ -89,7 +89,7 @@ void show_help()
" -U, --unified=<n> same as -u but use <n> lines of context\n"
" -v, --verbose verbose mode (for --version)\n"
" -w, --ignore-all-space ignore all white space\n"
- " -W, --width=<n> output at most <n> print columns\n"
+ " -W, --width=<n> output at most <n> print columns (for -y)\n"
" -y, --side-by-side output in two columns\n"
" --bz2=<command> set compressor and options for bzip2 format\n"
" --gz=<command> set compressor and options for gzip format\n"
@@ -317,7 +317,8 @@ int main( const int argc, const char * const argv[] )
const int code = parser.code( argind );
if( !code ) break; // no more options
const char * const pn = parser.parsed_name( argind ).c_str();
- const std::string & arg = parser.argument( argind );
+ const std::string & sarg = parser.argument( argind );
+ const char * const arg = sarg.c_str();
switch( code )
{
case 'a': diff_args.push_back( "-a" ); break;
@@ -325,14 +326,14 @@ int main( const int argc, const char * const argv[] )
case 'B': diff_args.push_back( "-B" ); break;
case 'c': diff_args.push_back( "-c" ); break;
case 'C': diff_args.push_back( "-C" );
- diff_args.push_back( arg.c_str() ); break;
+ diff_args.push_back( arg ); break;
case 'd': diff_args.push_back( "-d" ); break;
case 'E': diff_args.push_back( "-E" ); break;
case 'h': show_help(); return 0;
case 'i': diff_args.push_back( "-i" ); break;
- case 'M': parse_format_list( arg, pn ); break;
+ case 'M': parse_format_list( sarg, pn ); break;
case 'N': break;
- case 'O': parse_format_types2( arg, pn, format_types ); break;
+ case 'O': parse_format_types2( sarg, pn, format_types ); break;
case 'p': diff_args.push_back( "-p" ); break;
case 'q': diff_args.push_back( "-q" ); break;
case 's': diff_args.push_back( "-s" ); break;
@@ -340,18 +341,18 @@ int main( const int argc, const char * const argv[] )
case 'T': diff_args.push_back( "-T" ); break;
case 'u': diff_args.push_back( "-u" ); break;
case 'U': diff_args.push_back( "-U" );
- diff_args.push_back( arg.c_str() ); break;
+ diff_args.push_back( arg ); break;
case 'v': verbosity = 1; break;
case 'V': show_version( DIFF " --version" ); return 0;
case 'w': diff_args.push_back( "-w" ); break;
case 'W': diff_args.push_back( "-W" );
- diff_args.push_back( arg.c_str() ); break;
+ diff_args.push_back( arg ); break;
case 'y': diff_args.push_back( "-y" ); break;
- case bz2_opt: parse_compressor( arg, fmt_bz2 ); break;
- case gz_opt: parse_compressor( arg, fmt_gz ); break;
- case lz_opt: parse_compressor( arg, fmt_lz ); break;
- case xz_opt: parse_compressor( arg, fmt_xz ); break;
- case zst_opt: parse_compressor( arg, fmt_zst ); break;
+ case bz2_opt: parse_compressor( sarg, fmt_bz2 ); break;
+ case gz_opt: parse_compressor( sarg, fmt_gz ); break;
+ case lz_opt: parse_compressor( sarg, fmt_lz ); break;
+ case xz_opt: parse_compressor( sarg, fmt_xz ); break;
+ case zst_opt: parse_compressor( sarg, fmt_zst ); break;
default : internal_error( "uncaught option." );
}
} // end process options