Uploaded image for project: 'Module Tools'
  1. Module Tools
  2. MODTOOLS-92

imp2vs.exe - IMP format with multiline content - serious word join bug

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.7.4
    • Fix Version/s: None
    • Component/s: others
    • Labels:
      None
    • Environment:

      Windows 7 x64 (Toshiba Satellite) Home Premium edition.
      Fully patched.

      Sword utilities bundled with Xiphos.
      imp2vs.exe Revision $Rev: 2234 $
      Same version as last compliled by Greg H.

      Description

      According to our wiki page on file format, IMP format is

      "Each entry consists of a key line and any number of content lines."

      Yesterday, I observed what might be a buggy behaviour while using imp2vs.exe to build a module.

      The IMP file I have currently has Unix style EOLs (LF) rather than Windows style (CRLF).

      The module thus built joined the last word of content line N to the first word of line N+1 (under the same key).

      It ought to have inserted a space!

      Even stranger - adding a space at the end of each content line did not fix the issue.

      With multiline entries for many keys, changing to Windows style EOLs did NOT solve the issue.

      Aside: Being the sort of chap I am, I also tried Old Mac style EOLs (CR).
      Result = empty module. No records added! Less critical to be sure!
      How many source files do we get with Old Mac EOLs?

      It appears that imp2vs.exe does not fully comply with the definition of IMP format in
      http://crosswire.org/wiki/File_Formats#IMP

        Attachments

          Activity

          Hide
          dfh David Haslam added a comment -

          Today I added a paragraph about the continuation code \ to both wiki pages.

          See http://crosswire.org/wiki/DevTools:Modules#IMP_Format
          and http://crosswire.org/wiki/File_Formats#IMP

          Show
          dfh David Haslam added a comment - Today I added a paragraph about the continuation code \ to both wiki pages. See http://crosswire.org/wiki/DevTools:Modules#IMP_Format and http://crosswire.org/wiki/File_Formats#IMP
          Hide
          dfh David Haslam added a comment -

          Note: the bug primarily affects IMP files where the entries are mostly plain text.

          If all the entries were in XML or ThML elements, the symptom is less likely,
          unless of course the space in the text still occurs outside any such code,
          and is at the end of a line or the start of a line.

          Show
          dfh David Haslam added a comment - Note: the bug primarily affects IMP files where the entries are mostly plain text. If all the entries were in XML or ThML elements, the symptom is less likely, unless of course the space in the text still occurs outside any such code, and is at the end of a line or the start of a line.
          Hide
          dfh David Haslam added a comment -

          Scribe wrote to sword-devel as follows:

          Sorry for the delay responding to this thread. My apologies for time which might be wastes.

          The intent of imp format was to not require a single line for the entry data. Multiple lines (no need for a continuation ) should be fine.

          Looking at all the imp2* utils, imp2gbs uses FileMgr::getLine and adds a \n between lines. This is correct and how the other utils should work. imp2vs does not add the \n and should. imp2ld uses std::getline and does not add a \n and should be changed to use FileMgr calls instead, modeled after imp2gbs.

          Show
          dfh David Haslam added a comment - Scribe wrote to sword-devel as follows: Sorry for the delay responding to this thread. My apologies for time which might be wastes. The intent of imp format was to not require a single line for the entry data. Multiple lines (no need for a continuation ) should be fine. Looking at all the imp2* utils, imp2gbs uses FileMgr::getLine and adds a \n between lines. This is correct and how the other utils should work. imp2vs does not add the \n and should. imp2ld uses std::getline and does not add a \n and should be changed to use FileMgr calls instead, modeled after imp2gbs.
          Hide
          dfh David Haslam added a comment -

          Has this imp2vs issue since been fixed ?

          Show
          dfh David Haslam added a comment - Has this imp2vs issue since been fixed ?
          Hide
          scribe Troy A Griffitts added a comment -

          Looking at svn log,

          ------------------------------------------------------------------------
          r3403 | dmsmith | 2016-02-09 09:53:41 -0700 (Tue, 09 Feb 2016) | 1 line

          MODTOOLS-92 imp2vs multiline entry bug fixed. Changes patterned after imp2gbs

          ------------------------------------------------------------------------

          Show
          scribe Troy A Griffitts added a comment - Looking at svn log, ------------------------------------------------------------------------ r3403 | dmsmith | 2016-02-09 09:53:41 -0700 (Tue, 09 Feb 2016) | 1 line MODTOOLS-92 imp2vs multiline entry bug fixed. Changes patterned after imp2gbs ------------------------------------------------------------------------

            People

            • Assignee:
              refdoc Peter von Kaehne
              Reporter:
              dfh David Haslam
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: