From 6c688767d39b9c49d8fb0092b56f5f9dcaa91a50 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Fri, 11 Jul 2025 14:41:03 +0200 Subject: [PATCH] cd2cd: enable warnings, fix them --- scripts/cd2cd | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/scripts/cd2cd b/scripts/cd2cd index 3eaa0219e7..f4748f5d9b 100755 --- a/scripts/cd2cd +++ b/scripts/cd2cd @@ -36,13 +36,16 @@ Example: cd2cd [--in-place] > =end comment =cut +use strict; +use warnings; + my $cd2cd = "0.1"; # to keep check my $dir; my $extension; my $inplace = 0; while(1) { - if($ARGV[0] eq "--in-place") { + if(@ARGV && $ARGV[0] eq "--in-place") { shift @ARGV; $inplace = 1; } @@ -84,6 +87,9 @@ sub single { my $start = 0; my $d; my $line = 0; + my $salist = 0; + my $copyright; + my $spdx; open(F, "<:crlf", "$f") || return 1; while() { @@ -221,6 +227,6 @@ if($inplace) { single($a); } } -else { +elsif(@ARGV) { exit single($ARGV[0]); }