patch to edi4r
authorgmc <gmc@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 26 Jan 2011 21:58:47 +0000 (21:58 +0000)
committergmc <gmc@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 26 Jan 2011 21:58:47 +0000 (21:58 +0000)
This is a patch to edi4r which has been submitted; sticking
it here temporarily since at the moment it's unclear whether
edi4r still has an active maintainer.

This patch fixes a bug where question marks in the bibiographic
description ended up being escaped three times over.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>

git-svn-id: svn://svn.open-ils.org/ILS/trunk@19310 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/edi_translator/README
Open-ILS/src/edi_translator/misc/edi4r-unescaping.patch [new file with mode: 0644]

index 6c070fd..1b7e215 100644 (file)
@@ -1,6 +1,6 @@
 EDI Translator XML-RPC Service (for Evergreen)
 
-Copyright 2010
+Copyright 2010-2011
 License: GNU Public License v 2.0 or later
 
 Author: Joe Atzberger
@@ -18,6 +18,8 @@ Files:
     edi_webrick.rb   - the main EDI translator daemon script
     install.sh       - dependency installer (for debian lenny)
     README           - this file
+    misc/            - patches to EDI4R; purely temporary until we can
+                       get the changes accepted upstream
 
 This service can be run on a local or remote system that has the proper ruby environment
 established.  See the install.sh script for an example of how to install the needed ruby
diff --git a/Open-ILS/src/edi_translator/misc/edi4r-unescaping.patch b/Open-ILS/src/edi_translator/misc/edi4r-unescaping.patch
new file mode 100644 (file)
index 0000000..414bd1e
--- /dev/null
@@ -0,0 +1,11 @@
+--- old/lib/edi4r/edifact.rb   2011-01-26 11:25:45.000000000 -0500
++++ new/lib/edi4r/edifact.rb   2011-01-26 16:13:16.000000000 -0500
+@@ -342,7 +342,7 @@
+       special_chars = special_chars.map{|c| c.chr}
+       @pattern_esc = Regexp.new( [ '([', special_chars, '])' ].flatten.join)
+       @pattern_unesc = Regexp.new( [ 
+-                                     '([^', @esc_char, ']?)', '[', @esc_char,
++                                     '([^', @esc_char.chr, ']?)', '[', @esc_char.chr,
+                                      ']([', special_chars,'])' 
+                                    ].flatten.join )
+       root.show_una = true