cd2cd: enable warnings, fix them

This commit is contained in:
Viktor Szakats 2025-07-11 14:41:03 +02:00
parent f6ae4b7723
commit 6c688767d3
No known key found for this signature in database
GPG key ID: B5ABD165E2AEF201

View file

@ -36,13 +36,16 @@ Example: cd2cd [--in-place] <file.md> > <file.md>
=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(<F>) {
@ -221,6 +227,6 @@ if($inplace) {
single($a);
}
}
else {
elsif(@ARGV) {
exit single($ARGV[0]);
}