Skip to content

Commit

Permalink
g.proj: fix reading input WKT (OSGeo#1582)
Browse files Browse the repository at this point in the history
properly terminate input WKT string

Co-authored-by: Marc Jansen <jansen@terrestris.de>
  • Loading branch information
a0x8o and marcjansen committed Sep 5, 2024
1 parent 048ea15 commit 090fed9
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docker/alpine/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2418,6 +2418,7 @@ RUN apk add curl && curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py && p
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
=======
>>>>>>> main
<<<<<<< HEAD:docker/alpine/Dockerfile
Expand Down Expand Up @@ -2744,6 +2745,9 @@ RUN grass --tmp-location EPSG:4326 --exec g.version -rge && \
>>>>>>> osgeo-main
=======
RUN pip3 install --upgrade grass-session
=======
RUN pip3 install --upgrade pip six grass-session --ignore-installed six
>>>>>>> 460748a7fb (g.proj: fix reading input WKT (#1582))
RUN ln -s /usr/local/grass /usr/local/grass7
RUN ln -s /usr/local/grass `grass --config path`
Expand Down
11 changes: 11 additions & 0 deletions general/g.proj/input.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ int input_wkt(char *wktfile)
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
=======
>>>>>>> main
=======
Expand Down Expand Up @@ -226,6 +227,8 @@ int input_wkt(char *wktfile)
=======
>>>>>>> 7e7871fd90 (g.proj: fix reading input WKT (#1582))
>>>>>>> osgeo-main
=======
>>>>>>> 460748a7fb (g.proj: fix reading input WKT (#1582))
size_t wktlen;

wktlen = fread(buff, 1, sizeof(buff), infd);
Expand All @@ -251,6 +254,7 @@ int input_wkt(char *wktfile)
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
=======
<<<<<<< HEAD
>>>>>>> main
Expand Down Expand Up @@ -341,6 +345,9 @@ int input_wkt(char *wktfile)
>>>>>>> osgeo-main
=======
>>>>>>> osgeo-main
=======
=======
>>>>>>> 460748a7fb (g.proj: fix reading input WKT (#1582))
size_t wktlen;

wktlen = fread(buff, 1, sizeof(buff), infd);
Expand All @@ -366,6 +373,7 @@ int input_wkt(char *wktfile)
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
=======
>>>>>>> 250c6900d1 (g.proj: fix reading input WKT (#1582))
=======
Expand Down Expand Up @@ -589,6 +597,9 @@ int input_wkt(char *wktfile)
>>>>>>> osgeo-main
=======
>>>>>>> osgeo-main
=======
>>>>>>> b3579a4902 (g.proj: fix reading input WKT (#1582))
>>>>>>> 460748a7fb (g.proj: fix reading input WKT (#1582))
}
else
G_fatal_error(_("Unable to open file '%s' for reading"), wktfile);
Expand Down
8 changes: 8 additions & 0 deletions gui/wxpython/gui_core/prompt.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ def __init__(self, parent, giface, menuModel):
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
=======
<<<<<<< HEAD
<<<<<<< HEAD
Expand Down Expand Up @@ -162,6 +163,9 @@ def __init__(self, parent, giface, menuModel):
=======
>>>>>>> 7c10386e82 (g.proj: fix reading input WKT (#1582))
>>>>>>> osgeo-main
=======
=======
>>>>>>> 460748a7fb (g.proj: fix reading input WKT (#1582))

def _readHistory(self):
"""Get list of commands from history file"""
Expand All @@ -183,6 +187,7 @@ def _readHistory(self):
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
".wxgui_history",
=======
Expand Down Expand Up @@ -226,6 +231,9 @@ def _readHistory(self):
=======
".wxgui_history",
>>>>>>> osgeo-main
=======
".bash_history",
>>>>>>> 460748a7fb (g.proj: fix reading input WKT (#1582))
),
encoding="utf-8",
mode="r",
Expand Down
15 changes: 15 additions & 0 deletions python/grass/.flake8
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ ignore =
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
=======
>>>>>>> main
=======
Expand Down Expand Up @@ -282,6 +283,8 @@ ignore =
=======
E722, # do not use bare 'except'
>>>>>>> f4b9197871 (pythonlib: Remove star imports (#1546))
=======
>>>>>>> 460748a7fb (g.proj: fix reading input WKT (#1582))

per-file-ignores =
# C wrappers call libgis.G_gisinit before importing other modules.
Expand Down Expand Up @@ -320,6 +323,7 @@ per-file-ignores =
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
=======
>>>>>>> 398a3c2388 (g.proj: fix reading input WKT (#1582))
=======
Expand All @@ -342,6 +346,8 @@ per-file-ignores =
>>>>>>> osgeo-main
=======
>>>>>>> osgeo-main
=======
>>>>>>> 460748a7fb (g.proj: fix reading input WKT (#1582))
temporal/abstract_map_dataset.py: E501
temporal/abstract_space_time_dataset.py: W605, E501, F841, E722
temporal/aggregation.py: E501
Expand Down Expand Up @@ -370,6 +376,7 @@ per-file-ignores =
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
=======
<<<<<<< HEAD
=======
Expand Down Expand Up @@ -468,10 +475,18 @@ per-file-ignores =
temporal/*.py: E501, F841
temporal/abstract_space_time_dataset.py: W605, E501, F841
temporal/temporal_algebra.py: E741, E501, F841
=======
>>>>>>> 460748a7fb (g.proj: fix reading input WKT (#1582))
temporal/temporal_raster_algebra.py: E741
temporal/temporal_raster_base_algebra.py: E501, F841, E722
temporal/temporal_raster3d_algebra.py: E741
temporal/temporal_topology_dataset_connector.py: E501, E722
temporal/temporal_vector_algebra.py: E741, E501, F841
<<<<<<< HEAD
>>>>>>> f4b9197871 (pythonlib: Remove star imports (#1546))
=======
temporal/univar_statistics.py: E501
>>>>>>> 460748a7fb (g.proj: fix reading input WKT (#1582))
# Current benchmarks/tests are changing sys.path before import.
# Possibly, a different approach should be taken there anyway.
pygrass/tests/benchmark.py: E501, E402, F401, F821
Expand Down
9 changes: 9 additions & 0 deletions scripts/g.extension/g.extension.py
Original file line number Diff line number Diff line change
Expand Up @@ -831,6 +831,7 @@ def replace_shebang_win(python_file):
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
=======
HTTP_STATUS_CODES = list(http.HTTPStatus)
GIT_URL = "https://github.com/OSGeo/grass-addons"
Expand Down Expand Up @@ -1179,6 +1180,8 @@ def replace_shebang_win(python_file):

os.remove(python_file) # remove original
os.rename(tmp_name, python_file) # rename temp to original name
=======
>>>>>>> 460748a7fb (g.proj: fix reading input WKT (#1582))


def urlretrieve(url, filename, *args, **kwargs):
Expand Down Expand Up @@ -3762,6 +3765,7 @@ def install_extension_win(name):
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
if re.search(r"^[d,db,g,i,m,p,ps,r,r3,s,t,v,wx]\..*[\.py,\.exe]$", file):
=======
Expand Down Expand Up @@ -3799,6 +3803,8 @@ def install_extension_win(name):
>>>>>>> osgeo-main
=======
>>>>>>> osgeo-main
=======
>>>>>>> 460748a7fb (g.proj: fix reading input WKT (#1582))
if re.search(module_name_pattern, file):
=======
if re.search(r"^[d,db,g,i,m,p,ps,r,r3,s,t,v,wx]\..*[\.py,\.exe]$", file):
Expand All @@ -3814,6 +3820,7 @@ def install_extension_win(name):
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
<<<<<<< HEAD
=======
if re.search(r"^[d,db,g,i,m,p,ps,r,r3,s,t,v,wx]\..*[\.py,\.exe]$", file):
>>>>>>> 7c10386e82 (g.proj: fix reading input WKT (#1582))
Expand Down Expand Up @@ -3882,6 +3889,8 @@ def install_extension_win(name):
if re.search(r"^[d,db,g,i,m,p,ps,r,r3,s,t,v,wx]\..*[\.py,\.exe]$", file):
>>>>>>> 7c10386e82 (g.proj: fix reading input WKT (#1582))
>>>>>>> osgeo-main
=======
>>>>>>> 460748a7fb (g.proj: fix reading input WKT (#1582))
modulename = os.path.splitext(file)[0]
module_list.append(modulename)
# remove duplicates in case there are .exe wrappers for python scripts
Expand Down

0 comments on commit 090fed9

Please sign in to comment.