[GRASS-SVN] r30019 - grass/trunk/scripts/v.db.renamecol

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Feb 8 15:35:54 EST 2008


Author: neteler
Date: 2008-02-08 15:35:54 -0500 (Fri, 08 Feb 2008)
New Revision: 30019

Modified:
   grass/trunk/scripts/v.db.renamecol/v.db.renamecol
Log:
col length calc. polished

Modified: grass/trunk/scripts/v.db.renamecol/v.db.renamecol
===================================================================
--- grass/trunk/scripts/v.db.renamecol/v.db.renamecol	2008-02-08 17:57:10 UTC (rev 30018)
+++ grass/trunk/scripts/v.db.renamecol/v.db.renamecol	2008-02-08 20:35:54 UTC (rev 30019)
@@ -125,9 +125,8 @@
 newcol="`echo $GIS_OPT_COLUMN | cut -d',' -f2`"
 
 if [ "$driver" = "dbf" ] ; then
-  # strangely "" counts as 1
-  NAMELEN=`echo "$newcol" | wc -c | awk '{print $1}'`
-  if [ "$NAMELEN" -gt 11 ] ; then
+  NAMELEN=`echo -n "$newcol" | wc -c | awk '{print $1}'`
+  if [ "$NAMELEN" -gt 10 ] ; then
    g.message -e "Column name too long <$newcol>: the DBF driver only supports up to 10 characters as column name."
    cleanup
    exit 1



More information about the grass-commit mailing list