[latex3-commits] [latex3/latex3] gh684-file_input-raw: Issue error if 'raw' file is not found (3b75d86ca)

github at latex-project.org github at latex-project.org
Mon May 22 19:32:55 CEST 2023


Repository : https://github.com/latex3/latex3
On branch  : gh684-file_input-raw
Link       : https://github.com/latex3/latex3/commit/3b75d86ca2dadda42c08d7dc5c736f74847c3350

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

commit 3b75d86ca2dadda42c08d7dc5c736f74847c3350
Author: Joseph Wright <joseph.wright at morningstar2.co.uk>
Date:   Mon May 22 18:32:55 2023 +0100

    Issue error if 'raw' file is not found


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

3b75d86ca2dadda42c08d7dc5c736f74847c3350
 l3kernel/l3file.dtx              | 14 ++++++++++----
 l3kernel/testfiles/m3file001.tlg | 16 ++++++++++++++++
 2 files changed, 26 insertions(+), 4 deletions(-)

diff --git a/l3kernel/l3file.dtx b/l3kernel/l3file.dtx
index 262a2118b..2c1655056 100644
--- a/l3kernel/l3file.dtx
+++ b/l3kernel/l3file.dtx
@@ -3370,14 +3370,19 @@
 % \end{macro}
 % \end{macro}
 %
-% \begin{macro}{\file_input_raw:n, \@@_input_raw:n}
+% \begin{macro}{\file_input_raw:n, \@@_input_raw:nn}
 %   No error checking, no tracking.
 %    \begin{macrocode}
 \cs_new:Npn \file_input_raw:n #1
-  { \exp_args:Ne \@@_input_raw:n { \file_full_name:n {#1} } }
-\cs_new:Npx \@@_input_raw:n #1
+  { \exp_args:Ne \@@_input_raw:nn { \file_full_name:n {#1} } {#1} }
+\cs_new:Npx \@@_input_raw:nn #1#2
   {
-    \exp_not:N \tl_if_blank:nF {#1}
+    \exp_not:N \tl_if_blank:nTF {#1}
+      {
+        \exp_not:N \exp_args:Nnne \exp_not:N \msg_expandable_error:nnn
+          { kernel } { file-not-found }
+          { \exp_not:N \__kernel_file_name_sanitize:n {#2} }
+      }
       {
         \exp_not:N \tex_input:D
           \sys_if_engine_luatex:TF
@@ -3385,6 +3390,7 @@
             { \exp_not:N \__kernel_file_name_quote:n {#1} \scan_stop: }
         }
   }
+\exp_args_generate:n { nne }
 %    \end{macrocode}
 % \end{macro}
 %
diff --git a/l3kernel/testfiles/m3file001.tlg b/l3kernel/testfiles/m3file001.tlg
index 590c1529b..788559be7 100644
--- a/l3kernel/testfiles/m3file001.tlg
+++ b/l3kernel/testfiles/m3file001.tlg
@@ -60,6 +60,22 @@ search path or in the LaTeX search path.
 TEST 6: Loading a file raw
 ============================================================
 (filetest.txt) (filetest.txt)
+! Use of \??? doesn't match its definition.
+<argument> \???  
+                 ! LaTeX Error: File 'NotAFile.xxx.yyy.zzz' not found.
+l. ...  }
+If you say, e.g., `\def\a1{...}', then you must always
+put `1' after `\a', since control sequence names are
+made up of letters only. The macro here has not been
+followed by the required stuff, so I'm ignoring it.
+! Use of \??? doesn't match its definition.
+<argument> \???  
+                 ! LaTeX Error: File 'NotAFile.xxx.yyy.zzz' not found.
+l. ...  }
+If you say, e.g., `\def\a1{...}', then you must always
+put `1' after `\a', since control sequence names are
+made up of letters only. The macro here has not been
+followed by the required stuff, so I'm ignoring it.
 ============================================================
 ============================================================
 TEST 7: Loading a file conditionally





More information about the latex3-commits mailing list.