Skip to content

[Bug] r.info -e output line breaks not properly managed #491

@ninsbl

Description

@ninsbl

Describe the bug
With the -e flag, r.info removes line breaks in the comments / history and adds line continuation. As a result, history cannot be parsed.

To Reproduce
Steps to reproduce the behavior:

# Copy elevation map
g.copy raster=elevation,elevation_hist
# Add two lines to history
r.support elevation_hist history=BREAK
r.support elevation_hist history=ME

# Print extended info in key-value form (no line breaks)
r.info -e elevation_hist
# Print history (with line breaks)
r.info -h elevation_hist

Expected behavior
Result should be something like:

map=elevation_hist
(...)
comments="r.proj input="ned03arcsec" location="northcarolina_latlong" mapset="helena" output="elev_ned10m" method="cubic" resolution=10
BREAK
ME"

System description (please complete the following information):

version=7.9.dev
date=2019
revision=f1f82d16b
build_date=2019-12-03
build_platform=x86_64-pc-linux-gnu
build_off_t_size=8
libgis_revision=00000
libgis_date="?"
proj=5.2.0
gdal=2.3.2
geos=3.7.1
sqlite=3.26.0

Additional context
See: e.g.
#476
https://www.mail-archive.com/[email protected]/msg59103.html

Metadata

Metadata

Assignees

No one assigned

    Labels

    CRelated code is in CbugSomething isn't working

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions