Skip to contentSkip to conversation

master - system_id: omit leading hyphens from system_id

PATCH David Teigland 1 participant 1 message Feb 13, 2015

lore
Share & tools
lore
#0 lore raw
Gitweb:        http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=def0866ded7c11b1a93fa7bd093e2433d90f09d3
Commit:        def0866ded7c11b1a93fa7bd093e2433d90f09d3
Parent:        737c992431aed05ed21d55e08a801660d0faa4b1
Author:        David Teigland <[email protected]>
AuthorDate:    Fri Feb 13 11:14:46 2015 -0600
Committer:     David Teigland <[email protected]>
CommitterDate: Fri Feb 13 11:14:46 2015 -0600

system_id: omit leading hyphens from system_id

---
 lib/misc/lvm-string.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
lib/misc/lvm-string.c +8 -0
index 05d168a..f9cba31 100644
@@ -118,6 +118,14 @@ void copy_valid_chars(const char *src, char *dst)
 	if (!s || !*s)
 		return;
 
+	/* Omit leading hypens. */
+	for (i = 0; i < strlen(src); i++) {
+		c = *s;
+		if (c != '-')
+			break;
+		s++;
+	}
+
 	for (i = 0; i < strlen(src); i++) {
 		c = *s;