Show
Ignore:
Timestamp:
26.04.2016 19:22:56 (3 years ago)
Author:
ak19
Message:

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

Files:
1 modified

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;