X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Frrd_graph.c;h=eeff31c41ca33db51c06eb9737ac97a7ca156c9c;hb=82830f4f65a2f61b91d79e27983cf8025dd12dea;hp=bd7e3c341a2dd3f8934146736f14c3914363bcd0;hpb=8be74deb0aa2a4ee0898642ba9df8a3e5f3f97d6;p=rrdtool.git diff --git a/src/rrd_graph.c b/src/rrd_graph.c index bd7e3c3..eeff31c 100644 --- a/src/rrd_graph.c +++ b/src/rrd_graph.c @@ -1,5 +1,5 @@ /**************************************************************************** - * RRDtool 1.4.2 Copyright by Tobi Oetiker, 1997-2009 + * RRDtool 1.4.3 Copyright by Tobi Oetiker, 1997-2010 **************************************************************************** * rrd__graph.c produce graphs from data in rrdfiles ****************************************************************************/ @@ -1359,12 +1359,15 @@ int data_proc( return 0; } - static int find_first_weekday(void){ static int first_weekday = -1; if (first_weekday == -1){ -#if defined(HAVE_NL_LANGINFO) - first_weekday = nl_langinfo(_NL_TIME_FIRST_WEEKDAY)[0] - 1; +#ifdef HAVE__NL_TIME_WEEK_1STDAY + /* according to http://sourceware.org/ml/libc-locales/2009-q1/msg00011.html */ + long week_1stday_l = (long) nl_langinfo (_NL_TIME_WEEK_1STDAY); + if (week_1stday_l == 19971130) first_weekday = 0; /* Sun */ + else if (week_1stday_l == 19971201) first_weekday = 1; /* Mon */ + else first_weekday = 1; /* we go for a monday default */ #else first_weekday = 1; #endif @@ -4212,7 +4215,7 @@ void rrd_graph_options( int col_start, col_end; opt = getopt_long(argc, argv, - "Aa:B:b:c:Dd:Ee:Ff:G:gh:IiJjL:l:Nn:Bb:oPR:rS:s:T:t:u:v:W:w:X:x:Yy:z", + "Aa:B:b:c:Dd:Ee:Ff:G:gh:IiJjL:l:Mm:Nn:oPR:rS:s:T:t:u:v:W:w:X:x:Yy:z", long_options, &option_index); if (opt == EOF) break;