From 68c49db95233d03a25b27e01709cd052d60cef7a Mon Sep 17 00:00:00 2001
From: Colin Guthrie <colin@mageia.org>
Date: Sat, 18 Aug 2012 11:38:02 +0100
Subject: [PATCH] install/dracut-install.c: No need to compare the NULL byte
each time.
---
install/dracut-install.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/install/dracut-install.c b/install/dracut-install.c
index dfee259..c95b7c2 100644
--- a/install/dracut-install.c
+++ b/install/dracut-install.c
@@ -63,7 +63,7 @@ static size_t dir_len(char const *file)
{
size_t length;
/* Strip the basename and any redundant slashes before it. */
- for (length = strlen(file); 0 < length; length--)
+ for (length = strlen(file)-1; 0 < length; length--)
if (file[length] == '/' && file[length-1] != '/')
break;
return length;