1 Star 0 Fork 3

jinxu/perl-Test-Directory

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
Test-Directory-0.051-Fix-a-typo-in-clean-warning.patch 1.22 KB
一键复制 编辑 原始数据 按行查看 历史
jinxu 提交于 2021-06-28 18:20 . Initial package for openEuler
From 5d2a74bbbd12043880d0fab552e104d8ec9e3bd1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
Date: Wed, 25 Sep 2019 11:55:56 +0200
Subject: [PATCH] Fix a typo in clean() warning
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
The tests show:
t/builder-extra-dir.t .. ok
Use of uninitialized value $1 in concatenation (.) or string at /home/test/fedora/perl-Test-Directory/Test-Directory-0.051/blib/lib/Test/Directory.pm line 128.
test-directory-tmp-gRcbe: at t/builder.t line 54.
This is because a typo in clean() method. A failed rmdir function sets
$! variable, but a croak call interpolates $1 variable that is usually
undefined at that time.
This patch fixes it.
Signed-off-by: Petr Písař <ppisar@redhat.com>
---
lib/Test/Directory.pm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/Test/Directory.pm b/lib/Test/Directory.pm
index a6e6339..dddf250 100644
--- a/lib/Test/Directory.pm
+++ b/lib/Test/Directory.pm
@@ -127,7 +127,7 @@ sub clean {
rmdir $self->path($dir);
};
my $rv = rmdir $self->{dir};
- carp "$self->{dir}: $1" unless $rv;
+ carp "$self->{dir}: $!" unless $rv;
return $rv;
}
--
2.21.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/jinxu1992/perl-Test-Directory.git
git@gitee.com:jinxu1992/perl-Test-Directory.git
jinxu1992
perl-Test-Directory
perl-Test-Directory
master

搜索帮助