From ad847d9c2943bb063fec8207688659c2ed6c2345 Mon Sep 17 00:00:00 2001 From: Hannes Reinecke Date: Wed, 29 Oct 2008 16:58:52 +0100 Subject: [PATCH] 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 --- libmultipath/callout.c | 5 +++++ 1 file changed, 5 insertions(+) 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': -- 2.7.4