Ignore:
Timestamp:
May 4, 2026, 7:26:38 AM (9 days ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
master
Children:
244335b
Parents:
8403b32
Message:

harmonize output quote manipulator with input quote manipulator, adding left/right quote parameters

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/iostream.cfa

    r8403b32 rbb1eabc  
    1010// Created On       : Wed May 27 17:56:53 2015
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sun May  3 08:08:29 2026
    13 // Update Count     : 2241
     12// Last Modified On : Sun May  3 22:02:37 2026
     13// Update Count     : 2271
    1414//
    1515
     
    698698                } // if
    699699                if ( f.flags.quote ) {                                                  // print as string
    700                         char qv[] = "' '";
    701                         qv[1] = f.val;
     700                        char qv[] = { f.qleft, f.val, f.qright ? : f.qleft, '\0' };
    702701                        f.flags.quote = false;                                          // already quoted
    703702                        _Ostream_Manip(const char *) fmtuc @= { qv, f.wd, f.pc, 's', {f.all} };
     
    743742                        int len = strlen( f.val );
    744743                        char qv[len + 3];                                                       // space for quotes and '\0'
    745                         qv[0] = '"';                                                            // copy string surrounded with quotes
    746                         strcpy( &qv[1], f.val );
    747                         qv[len + 1] = '"';
    748                         qv[len + 2] = '\0';
     744                        qv[0] = f.qleft; strcpy( &qv[1], f.val );
     745                        qv[len + 1] = f.qright ? : f.qleft; qv[len + 2] = '\0'; // copy string surrounded with quotes
    749746                        f.flags.quote = false;                                          // already quoted
    750747                        _Ostream_Manip(const char *) fmtuc @= { qv, f.wd, f.pc, 's', {f.all} };
Note: See TracChangeset for help on using the changeset viewer.