Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 500614 | Differences between
and this patch

Collapse All | Expand All

(-)grass.orig/lib/gis/error.c (+25 lines)
Lines 246-251 Link Here
246
    return 0;
246
    return 0;
247
}
247
}
248
248
249
static const char *sgr_start = "\33[%sm\33[K";
250
static const char *sgr_end   = "\33[m\33[K";
251
static const char *colors[2][3] = {
252
  {NULL, "01;35", "01;31"}, /* Bold magenta, bold red */
253
  {NULL, "35", "31"}        /* (32 - green), 35 - magenta, 31 - red */
254
};
255
256
static void colorize_start(FILE * fd, const int type, const int where)
257
{
258
  if (colors[where][type] && isatty(fileno(fd))) {
259
    fprintf(stderr, sgr_start, colors[where][type]);
260
  }
261
}
262
263
static void colorize_stop(FILE * fd, const int type, const int where)
264
{
265
  if (colors[where][type] && isatty(fileno(fd))) {
266
    fprintf(stderr, sgr_end);
267
  }
268
}
269
249
/* Print info to stderr and optionally to log file and optionally send mail */
270
/* Print info to stderr and optionally to log file and optionally send mail */
250
static int print_error(const char *msg, const int type)
271
static int print_error(const char *msg, const int type)
251
{
272
{
Lines 277-287 Link Here
277
		log_error(msg, fatal);
298
		log_error(msg, fatal);
278
	    }
299
	    }
279
300
301
	    colorize_start(stderr, type, 0);
280
	    fprintf(stderr, "%s", prefix_std[type]);
302
	    fprintf(stderr, "%s", prefix_std[type]);
303
	    colorize_stop(stderr, type, 0);
281
	    len = lead = strlen(prefix_std[type]);
304
	    len = lead = strlen(prefix_std[type]);
282
	    w = (char *)msg;
305
	    w = (char *)msg;
283
306
307
	    colorize_start(stderr, type, 1);
284
	    while (print_word(stderr, &w, &len, lead)) ;
308
	    while (print_word(stderr, &w, &len, lead)) ;
309
	    colorize_stop(stderr, type, 1);
285
310
286
	    if ((type != MSG) && isatty(fileno(stderr))
311
	    if ((type != MSG) && isatty(fileno(stderr))
287
		&& (G_info_format() == G_INFO_FORMAT_STANDARD)) {	/* Bell */
312
		&& (G_info_format() == G_INFO_FORMAT_STANDARD)) {	/* Bell */
(-)grass.orig/lib/init/init.sh (+2 lines)
Lines 886-891 Link Here
886
if [ -n "$GRASS_BATCH_JOB" ] ; then
886
if [ -n "$GRASS_BATCH_JOB" ] ; then
887
  say_hello
887
  say_hello
888
else
888
else
889
  printf "\33[01;32m\33[K"
889
  cat <<EOF
890
  cat <<EOF
890
          __________  ___   __________    _______________
891
          __________  ___   __________    _______________
891
         / ____/ __ \/   | / ___/ ___/   / ____/  _/ ___/
892
         / ____/ __ \/   | / ___/ ___/   / ____/  _/ ___/
Lines 894-899 Link Here
894
       \____/_/ |_/_/  |_/____/____/   \____/___//____/  
895
       \____/_/ |_/_/  |_/____/____/   \____/___//____/  
895
896
896
EOF
897
EOF
898
  printf "\33[m\33[K"
897
899
898
  say_hello
900
  say_hello
899
  echo "GRASS homepage:                          http://grass.osgeo.org/"
901
  echo "GRASS homepage:                          http://grass.osgeo.org/"

Return to bug 500614