[GRASS-SVN] r32547 - grass/trunk/raster/r.colors
svn_grass at osgeo.org
svn_grass at osgeo.org
Tue Aug 5 17:02:57 EDT 2008
Author: martinl
Date: 2008-08-05 17:02:57 -0400 (Tue, 05 Aug 2008)
New Revision: 32547
Modified:
grass/trunk/raster/r.colors/main.c
Log:
revert accidentally committed changes, sorry! (r32546)
Modified: grass/trunk/raster/r.colors/main.c
===================================================================
--- grass/trunk/raster/r.colors/main.c 2008-08-05 20:58:03 UTC (rev 32546)
+++ grass/trunk/raster/r.colors/main.c 2008-08-05 21:02:57 UTC (rev 32547)
@@ -109,7 +109,6 @@
char *style, *cmap, *cmapset;
char *rules;
int fp;
- FILE *rules_file;
struct GModule *module;
struct
{
@@ -238,7 +237,6 @@
cmap = opt.rast->answer;
rules = opt.rules->answer;
- rules_file = NULL;
if (!name)
G_fatal_error(_("No map specified"));
@@ -246,11 +244,11 @@
G_fatal_error(_
("One of \"-i\" or \"-r\" or options \"color\", \"rast\" or \"rules\" must be specified!"));
- if (interactive && ((strcmp(style, "rules") && rules) || cmap))
+ if (interactive && (style || rules || cmap))
G_fatal_error(_
("Interactive mode is incompatible with \"color\", \"rules\", and \"raster\" options"));
- if ((strcmp(style, "rules") && (cmap || rules)) || (cmap && rules))
+ if ((style && (cmap || rules)) || (cmap && rules))
G_fatal_error(_
("\"color\", \"rules\", and \"raster\" options are mutually exclusive"));
@@ -315,11 +313,7 @@
(CELL) max);
}
else if (strcmp(style, "rules") == 0) {
- rules_file = fopen(rules, "r");
- if (rules_file == NULL) {
- G_fatal_error(_("Unable to open rules file <%s>"), rules);
- }
- if (!read_color_rules(rules_file, &colors, min, max, fp))
+ if (!read_color_rules(stdin, &colors, min, max, fp))
exit(EXIT_FAILURE);
}
else if (find_rule(style))
More information about the grass-commit
mailing list