Browse Source

Quote map names in mapcalc to prevent failures if input/output name is also a valid mapcalc expression

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@69787 15284696-431f-4ddb-bdfa-cd5b030d7da7
Maris Nartiss 8 years ago
parent
commit
92027345ff
1 changed files with 3 additions and 3 deletions
  1. 3 3
      scripts/r.fillnulls/r.fillnulls.py

+ 3 - 3
scripts/r.fillnulls/r.fillnulls.py

@@ -173,10 +173,10 @@ def main():
         # creating binary (0/1) map
         if usermask:
             grass.message(_("Skipping masked raster parts"))
-            grass.mapcalc("$tmp1 = if(isnull($input) && !($mask == 0 || isnull($mask)),1,null())",
+            grass.mapcalc("$tmp1 = if(isnull(\"$input\") && !($mask == 0 || isnull($mask)),1,null())",
                           tmp1=prefix + 'nulls', input=input, mask=usermask)
         else:
-            grass.mapcalc("$tmp1 = if(isnull($input),1,null())",
+            grass.mapcalc("$tmp1 = if(isnull(\"$input\"),1,null())",
                           tmp1=prefix + 'nulls', input=input)
         tmp_rmaps.append(prefix + 'nulls')
 
@@ -311,7 +311,7 @@ def main():
                               "user mask if needed:"))
 
             # no idea why r.grow old=-1 doesn't replace existing values with NULL
-            grass.mapcalc("$out = if($inp == -1, null(), $dem)",
+            grass.mapcalc("$out = if($inp == -1, null(), \"$dem\")",
                           out=holename + '_edges', inp=holename + '_grown', dem=input)
             tmp_rmaps.append(holename + '_edges')