[texdoc] texdoctk: uninitialized $_ causes issues with KDE

John Scott jscott at posteo.net
Wed Mar 4 02:24:11 CET 2020


Hello,

I was investigating why, when using texdoctk from KDE, it sometimes gives the error
 The file or folder smb://usr/share/texlive/texmf-dist/doc/latex/hyperref/manual.pdf does not exist.

I know very little about Perl, but I think I've identified the cause:

Use of uninitialized value $_ in concatenation (.) or string at /usr/bin/texdoctk line 676.
 at /usr/bin/texdoctk line 676.
        main::finddoc(undef, "/usr/share/texlive/texmf-dist/doc/latex/hyperref/manual.pdf", Tk::Frame=HASH(0x55713adfc100)) called at /usr/bin/texdoctk line 461
        main::viewslc("/usr/share/texlive/texmf-dist/doc/latex/hyperref/manual.pdf", Tk::Frame=HASH(0x55713adfc100)) called at /usr/bin/texdoctk line 375
        main::__ANON__[/usr/bin/texdoctk:375](Tk::Listbox=HASH(0x55713adb9490)) called at /usr/lib/x86_64-linux-gnu/perl5/5.30/Tk.pm line 424
        eval {...} called at /usr/lib/x86_64-linux-gnu/perl5/5.30/Tk.pm line 424
        Tk::MainLoop() called at /usr/bin/texdoctk line 276

and also, when a path is given with two leading slashes like //usr/..., that
is what makes KDE assume smb://. If $_ is empty, that leaves the slash after
it still there.

This small patch gets it working on my system:
--- /usr/bin/texdoctk   2020-02-17 17:37:38.000000000 -0500
+++ ./texdoctk-my       2020-03-03 20:05:37.580339295 -0500
@@ -673,7 +673,7 @@
     my($slcdoc,$slc,$parframe)=@_;
     my ($dummy,$status);
   SLCDOCFIND: foreach ($texdocpath,$distdocpath,$docdocpath) {
-      $slcdoc="$_/$slc";
+      $slcdoc="$slc";
       if (-e $slcdoc) {
 #       found where it should be
        return $slcdoc;

I wonder if, on others' installations, $_ is ever non-empty, and maybe this
checkig the additional path has never worked at all.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: This is a digitally signed message part.
URL: <https://tug.org/pipermail/texdoc/attachments/20200303/c03d6a64/attachment.sig>


More information about the texdoc mailing list.