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

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'newlib/libc/string/uniset')
-rwxr-xr-xnewlib/libc/string/uniset29
1 files changed, 15 insertions, 14 deletions
diff --git a/newlib/libc/string/uniset b/newlib/libc/string/uniset
index 85d3b2a6f..b118dd663 100755
--- a/newlib/libc/string/uniset
+++ b/newlib/libc/string/uniset
@@ -2,7 +2,7 @@
# Uniset -- Unicode subset manager -- Markus Kuhn
# http://www.cl.cam.ac.uk/~mgk25/download/uniset.tar.gz
-require 5.008;
+require 5.014;
use open ':utf8';
use FindBin qw($RealBin); # to find directory where this file is located
@@ -147,11 +147,12 @@ sub is_unicode {
return exists $name{$ucs};
}
-my @search_path;
-push @search_path, "$ENV{HOME}/local/share/uniset"
- if -d "$ENV{HOME}/local/share/uniset";
-push @search_path, "/usr/share/uniset" if -d "/usr/share/uniset";
-push @search_path, $RealBin unless $RealBin =~ m|^/usr/bin|;
+my @search_path = ();
+if ($RealBin =~ m|^(.*)/bin\z| && -d "$1/share/uniset") {
+ push @search_path, "$1/share/uniset";
+} else {
+ push @search_path, $RealBin;
+}
sub search_open {
my ($mode, $fn) = @_;
@@ -186,7 +187,7 @@ while (<$data>) {
$category{$ucs} = $3;
$comment{$ucs} = $12;
} else {
- die("Syntax error in line '$_' in file '$unicodedata'");
+ die("Syntax error in line '$_' in file '$unicodedata'\n");
}
}
close($data);
@@ -209,7 +210,7 @@ while (<$data>) {
} elsif (/^\s*\#/ || /^\s*$/) {
# ignore comments and empty lines
} else {
- die("Syntax error in line '$_' in file '$blockdata'");
+ die("Syntax error in line '$_' in file '$blockdata'\n");
}
}
close($data);
@@ -231,16 +232,16 @@ while ($_ = shift(@ARGV)) {
$image = 1;
} elsif (/^template$/) {
$template = shift(@ARGV);
- open(TEMPLATE, $template) || die("Can't open template file '$template': '$!'");
+ open(TEMPLATE, $template) || die("Can't open template file '$template': $!\n");
while (<TEMPLATE>) {
if (/^\#\s*include\s+\"([^\"]*)\"\s*$/) {
- open(INCLUDE, $1) || die("Can't open template include file '$1': '$!'");
+ open(INCLUDE, $1) || die("Can't open template include file '$1': $!\n");
while (<INCLUDE>) {
print $_;
}
close(INCLUDE);
} elsif (/^\#\s*quote\s+\"([^\"]*)\"\s*$/) {
- open(INCLUDE, $1) || die("Can't open template include file '$1': '$!'");
+ open(INCLUDE, $1) || die("Can't open template include file '$1': $!\n");
while (<INCLUDE>) {
s/&/&amp;/g;
s/</&lt;/g;
@@ -275,7 +276,7 @@ while ($_ = shift(@ARGV)) {
$setfile = $2;
$setfile = shift(@ARGV) if $setfile eq "";
push(@SETS, $setfile);
- open(SET, $setfile) || die("Can't open set file '$setfile': '$!'");
+ open(SET, $setfile) || die("Can't open set file '$setfile': $!\n");
$setname = $setfile;
while (<SET>) {
while ($_) {
@@ -303,7 +304,7 @@ while ($_ = shift(@ARGV)) {
$setfile = shift(@ARGV) if $setfile eq "";
push(@SETS, $setfile);
my $setf = search_open('<', $setfile);
- die("Can't open set file '$setfile': '$!'") unless $setf;
+ die("Can't open set file '$setfile': $!\n") unless $setf;
$cedf = ($setfile =~ /cedf/); # detect Kosta Kosti's trans CEDF format by path name
$setname = $setfile;
$setname =~ s/([^.\[\]]*)\..*/$1/;
@@ -691,6 +692,6 @@ while ($_ = shift(@ARGV)) {
delete $used{$i} if is_unicode($i);
}
} else {
- die("Unknown command line command '$_'");
+ die("Unknown command line command '$_'\n");
};
}