[GRASS-SVN] r74017 - grass/trunk/tools

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Jan 25 21:02:55 PST 2019


Author: hcho
Date: 2019-01-25 21:02:55 -0800 (Fri, 25 Jan 2019)
New Revision: 74017

Modified:
   grass/trunk/tools/grass_indent.sh
Log:
grass_indent.sh: Handle multiple files and filenames with spaces properly

Modified: grass/trunk/tools/grass_indent.sh
===================================================================
--- grass/trunk/tools/grass_indent.sh	2019-01-26 04:34:46 UTC (rev 74016)
+++ grass/trunk/tools/grass_indent.sh	2019-01-26 05:02:55 UTC (rev 74017)
@@ -26,8 +26,10 @@
 
  # fix broken gettext macros:
  grep -l '\<_$' "$@" | \
-     while read file ; do sed -i -e '/[( \t]_$/{;N;s/\n[ \t]*//;}' $file ; done
+  while read file ; do sed -i -e '/[( \t]_$/{;N;s/\n[ \t]*//;}' "$file" ; done
 
  # restore original file with timestamp if indent did not change anything
- cmp "$@"~ "$@" > /dev/null && mv -f "$@"~ "$@"
+ for file in "$@" ; do
+  cmp "$file"~ "$file" > /dev/null && mv -f "$file"~ "$file"
+ done
 fi



More information about the grass-commit mailing list