Changeset 30484


Ignore:
Timestamp:
2016-04-26T19:22:56+12:00 (8 years ago)
Author:
ak19
Message:

Bugfix by DLConsulting's Andrew Holland submitted via email on 14/04/16 and merged into the code today.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/runtime-src/src/recpt/formattools.cpp

    r29042 r30484  
    15221522  text_t outtext;
    15231523
     1524  // Check if the string is empty. If it is, do not do anything
     1525  if (intext.empty())
     1526  {
     1527    outtext = intext;
     1528    return outtext;
     1529  }
     1530
    15241531  // decide if dealing with metadata or text
    15251532
     
    15871594  if ((potential_quote == '\'') || (potential_quote == '\"')) {
    15881595    --rhs_end;
    1589     rhs_start = rscan_for(outstring,rhs_end-1,potential_quote) +1;
     1596    // We have already decremented rhs_end, so we want to look at the current value for rhs_end (allows empty quoted strings)
     1597    rhs_start = rscan_for(outstring,rhs_end,potential_quote) +1;
    15901598    quoted = true;
    15911599  }
     
    15941602  }
    15951603
    1596   if ((rhs_end-rhs_start)<0) {
     1604  // Allow empty quoted strings
     1605  if ((rhs_end-rhs_start)<0 && !quoted) {
    15971606    // no meaningful rhs expression
    15981607    return false;
Note: See TracChangeset for help on using the changeset viewer.