[latex3-commits] [git/LaTeX3-latex3-latex2e] unquote: try adding known extensions even if supplied filename has a dot (dba9642f)

David Carlisle d.p.carlisle at gmail.com
Sun Nov 3 20:52:20 CET 2019


Repository : https://github.com/latex3/latex2e
On branch  : unquote
Link       : https://github.com/latex3/latex2e/commit/dba9642f2bff2f40b33d46c5ba80735b23b87096

>---------------------------------------------------------------

commit dba9642f2bff2f40b33d46c5ba80735b23b87096
Author: David Carlisle <d.p.carlisle at gmail.com>
Date:   Sun Nov 3 19:52:20 2019 +0000

    try adding known extensions even if supplied filename has a dot


>---------------------------------------------------------------

dba9642f2bff2f40b33d46c5ba80735b23b87096
 required/graphics/graphics.dtx | 30 +++++++++++++++++++++++++++++-
 1 file changed, 29 insertions(+), 1 deletion(-)

diff --git a/required/graphics/graphics.dtx b/required/graphics/graphics.dtx
index b431162e..ac570c02 100644
--- a/required/graphics/graphics.dtx
+++ b/required/graphics/graphics.dtx
@@ -1122,7 +1122,7 @@
     \ifx\filename at ext\relax
       \let\filename at ext\Gin at gzext
     \else
-      \edef\Gin at ext{\Gin at ext.\Gin at gzext}%
+      \edef\Gin at ext{\Gin at ext\Gin at sepdefault\Gin at gzext}%
     \fi
   \fi
   \ifx\filename at ext\relax
@@ -1133,6 +1133,34 @@
   \else
     \Gin at getbase{\Gin at sepdefault\filename at ext}%
 %    \end{macrocode}
+% At this point try adding an extension, even if the filename has one so
+% that \verb|a.b| may find \verb|a.b.png| if no file is found then revert
+% to the extension as given to get better error reporting.
+%
+% \changes{v1.3d}{2019/11/01}
+%     {Try adding an extension even if the filenam had a dot.}
+%    \begin{macrocode}
+\ifx\Gin at ext\relax
+\let\Gin at savedbase\filename at base
+\let\Gin at savedext\filename at ext
+  \edef\filename at base{\filename at base\Gin at sepdefault\filename at ext}%
+  \let\filename at ext\relax
+   \@for\Gin at temp:=\Gin at extensions\do{%
+      \ifx\Gin at ext\relax
+        \Gin at getbase\Gin at temp
+      \fi}%
+%    \end{macrocode}
+% Restore if no file found using theknown extensions.
+%    \begin{macrocode}
+  \ifx\Gin at ext\relax
+    \let\filename at base\Gin at savedbase
+    \let\filename at ext\Gin at savedext
+  \fi
+\fi
+%    \end{macrocode}
+%
+%    \begin{macrocode}
+%    \end{macrocode}
 % \changes{v0.4d}{1994/05/06}
 %     {Make file not found a warning not an error}
 % \changes{v0.6a}{1994/11/29}





More information about the latex3-commits mailing list