From: Tobias Oetiker Date: Tue, 12 Aug 2008 06:48:37 +0000 (+0000) Subject: make sure imageinfo only reports the filename and not the whole path. This is a regre... X-Git-Tag: 1.3.2~25 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0f0d1bb3c54ad0bade473b1d1391002c1aef2be5;p=thirdparty%2Frrdtool-1.x.git make sure imageinfo only reports the filename and not the whole path. This is a regression from 1.2.x where this was implemented properly. git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk/program@1459 a5681a0c-68f1-0310-ab6d-d61299d08faa --- diff --git a/src/rrd_graph.c b/src/rrd_graph.c index 57a1bb6d..7ff68872 100644 --- a/src/rrd_graph.c +++ b/src/rrd_graph.c @@ -3667,10 +3667,15 @@ rrd_info_t *rrd_graph_v( if (im.imginfo) { rrd_infoval_t info; - + char *filename; + filename=im.graphfile+strlen(im.graphfile); + while(filename > im.graphfile) { + if (*(filename-1)=='/' || *(filename-1)=='\\' ) break; + filename--; + } info.u_str = sprintf_alloc(im.imginfo, - im.graphfile, + filename, (long) (im.zoom * im.ximg), (long) (im.zoom * im.yimg)); grinfo_push(&im, sprintf_alloc("image_info"), RD_I_STR, info);