From 6cd247d6533fa4b994f44ef25e30fb2d3c105e53 Mon Sep 17 00:00:00 2001 From: William S Fulton Date: Sun, 2 Dec 2012 13:37:10 +0000 Subject: [PATCH] Correct prefix handling - bug introduced in rev 13886 git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@13945 626c5289-ae23-0410-ae9c-e8d60b6d4f22 --- Source/Modules/guile.cxx | 2 +- Source/Modules/mzscheme.cxx | 3 +-- Source/Modules/ocaml.cxx | 3 +-- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/Source/Modules/guile.cxx b/Source/Modules/guile.cxx index c7e8fe7e4..0777b316f 100644 --- a/Source/Modules/guile.cxx +++ b/Source/Modules/guile.cxx @@ -280,7 +280,7 @@ public: // Make sure `prefix' ends in an underscore if (prefix) { const char *px = Char(prefix); - if (px[Len(prefix)] != '_') + if (px[Len(prefix) - 1] != '_') Printf(prefix, "_"); } diff --git a/Source/Modules/mzscheme.cxx b/Source/Modules/mzscheme.cxx index c2abd7ec4..e2f44deef 100644 --- a/Source/Modules/mzscheme.cxx +++ b/Source/Modules/mzscheme.cxx @@ -101,10 +101,9 @@ public: } // If a prefix has been specified make sure it ends in a '_' (not actually used!) - if (prefix) { const char *px = Char(prefix); - if (px[Len(prefix)] != '_') + if (px[Len(prefix) - 1] != '_') Printf(prefix, "_"); } else prefix = NewString("swig_"); diff --git a/Source/Modules/ocaml.cxx b/Source/Modules/ocaml.cxx index 9fc5e9c71..beac03237 100644 --- a/Source/Modules/ocaml.cxx +++ b/Source/Modules/ocaml.cxx @@ -130,10 +130,9 @@ public: } // If a prefix has been specified make sure it ends in a '_' (not actually used!) - if (prefix) { const char *px = Char(prefix); - if (px[Len(prefix)] != '_') + if (px[Len(prefix) - 1] != '_') Printf(prefix, "_"); } else prefix = NewString("swig_");