Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mRemoteNG/PuTTYNG.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'charset/sbcsgen.pl')
-rwxr-xr-x[-rw-r--r--]charset/sbcsgen.pl14
1 files changed, 11 insertions, 3 deletions
diff --git a/charset/sbcsgen.pl b/charset/sbcsgen.pl
index 078aebf7..6012c933 100644..100755
--- a/charset/sbcsgen.pl
+++ b/charset/sbcsgen.pl
@@ -1,11 +1,19 @@
-#!/usr/bin/env perl -w
+#!/usr/bin/env perl
# This script generates sbcsdat.c (the data for all the SBCSes) from its
# source form sbcs.dat.
-$infile = "sbcs.dat";
+use warnings;
+use Getopt::Long;
+use File::Basename;
+
+$infile = (dirname __FILE__) . "/sbcs.dat";
$outfile = "sbcsdat.c";
+my $usage = "usage: sbcsgen.pl [-o OUTFILE]\n";
+GetOptions("o|output=s" => \$outfile)
+ or die $usage;
+
open FOO, $infile;
open BAR, ">$outfile";
select BAR;
@@ -30,7 +38,7 @@ my @charsetnames = ();
my @sortpriority = ();
while (<FOO>) {
- chomp;
+ chomp; y/\r//d;
if (/^charset (.*)$/) {
$charsetname = $1;
@vals = ();