From 4934aad4dca4ef0ec493b7871028f94a7bbfc0f0 Mon Sep 17 00:00:00 2001 From: Radek Novacek Date: Tue, 4 Aug 2015 12:31:51 +0200 Subject: [PATCH] konkretreg: ignore KONKRET_REGISTRATION macro in library On some systems the KONKRET_REGISTRATION macro definition gets compiled into the provider library and then konkretreg generates incorrect registration file. This commit adds a check for this case. Fixes #6. --- src/konkretreg/main.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/konkretreg/main.cpp b/src/konkretreg/main.cpp index 9b0f323..bba47af 100644 --- a/src/konkretreg/main.cpp +++ b/src/konkretreg/main.cpp @@ -180,6 +180,15 @@ int main(int argc, char** argv) { if (memcmp(p, REG, sizeof(REG)-1) == 0) { + if (n > 0 && *(p - 1) == '"') + { + // Some systems generate entry for the macro itself, we're not + // interested in it. There is a doublequote sign before name + // of the entry. + p++; + n--; + continue; + } char buf[4096]; size_t r = strlen(p) + 1;