From 2fc2609488764102ce43194e9288b7bd8e25f17f Mon Sep 17 00:00:00 2001
From: Norbert Preining <norbert@preining.info>
Date: Sun, 16 May 2021 03:00:44 +0000
Subject: CTAN sync 202105160300

---
 graphics/pgf/base/tex/pgfsys.code.tex | 25 ++++++++++++++++++++++++-
 1 file changed, 24 insertions(+), 1 deletion(-)

(limited to 'graphics/pgf/base/tex/pgfsys.code.tex')

diff --git a/graphics/pgf/base/tex/pgfsys.code.tex b/graphics/pgf/base/tex/pgfsys.code.tex
index 000eef098c..fd87b09181 100644
--- a/graphics/pgf/base/tex/pgfsys.code.tex
+++ b/graphics/pgf/base/tex/pgfsys.code.tex
@@ -1715,7 +1715,30 @@
 % inserted into the resulting .pdf/.ps/.xxx file.
 
 
-
+% String comparison
+\ifdefined\pdfstrcmp
+  \let\pgfsys@strcmp\pdfstrcmp
+\else\ifdefined\strcmp
+  \let\pgfsys@strcmp\strcmp
+\else\ifdefined\directlua
+  \directlua{
+  local lft = lua.get_functions_table()
+  lft[\string#lft+1] = function()
+      local lhs = token.scan_string()
+      local rhs = token.scan_string()
+      if lhs < rhs then
+          tex.sprint(-2, "-1")
+      elseif lhs == rhs then
+          tex.sprint(-2, "0")
+      else
+          tex.sprint(-2, "1")
+      end
+  end
+  token.set_lua("pgfsys@strcmp", \string#lft, "global")
+  }
+\else
+  \def\pgfsys@strcmp#1#2{\pgf@sys@fail{string comparison}}%
+\fi\fi\fi
 
 
 % Discern the driver:
-- 
cgit v1.2.3

