From 643921ac883be8af9dad01e441028d3564aea565 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Fri, 13 Aug 1999 14:36:52 +0000 Subject: no_comment --- perl-install/devices.pm | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'perl-install/devices.pm') diff --git a/perl-install/devices.pm b/perl-install/devices.pm index ac72bc3ed..7932eb21b 100644 --- a/perl-install/devices.pm +++ b/perl-install/devices.pm @@ -38,13 +38,16 @@ sub size($) { sub make($) { local $_ = my $file = $_[0]; my ($type, $major, $minor); - my ($prefix); + my $prefix = ''; - unless (s,^(.*)/(dev|tmp)/,,) { + if (m,^(.*)/(dev|tmp)/(.*),) { $prefix = $1; - $file = -e "$prefix/dev/$file" ? "$prefix/dev/$file" : "$prefix/tmp/$file"; + $_ = $3; + } elsif (m,/,) { + die "can't make device $file"; } - + $file = "$prefix/dev/$_"; + -e $file or $file = "$prefix/tmp/$_"; -e $file and return $file; # assume nobody takes fun at creating files named as device if (/^sd(.)(\d{0,2})/) { -- cgit v1.2.1