From: Hannes Reinecke Date: Wed, 29 Oct 2008 15:58:52 +0000 (+0100) Subject: Fixup %n to handle '!' special case X-Git-Tag: 0.4.9~112 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ad847d9c2943bb063fec8207688659c2ed6c2345;p=platform%2Fupstream%2Fmultipath-tools.git Fixup %n to handle '!' special case The kernel name may contain an '!', which should be translated into a '/'. So do it here. Signed-off-by: Hannes Reinecke --- diff --git a/libmultipath/callout.c b/libmultipath/callout.c index a0f74e9..520343e 100644 --- a/libmultipath/callout.c +++ b/libmultipath/callout.c @@ -148,6 +148,7 @@ apply_format (char * string, char * cmd, struct path * pp) char * pos; char * dst; char * p; + char * q; int len; int myfree; @@ -186,6 +187,10 @@ apply_format (char * string, char * cmd, struct path * pp) return 1; snprintf(p, len, "%s", pp->dev); + for (q = p; q < p + len; q++) { + if (q && *q == '!') + *q = '/'; + } p += len - 1; break; case 'd':