forked from enlightenment/efl
efl/eina_prefix: whitespace cleanup as pointed by kuri at #edevelop
trailing whitespacesd and mixed tabs (old style) are gone. SVN revision: 82470
This commit is contained in:
parent
37ab81a620
commit
8ac159bfe2
|
@ -243,43 +243,43 @@ _try_proc(Eina_Prefix *pfx, void *symbol)
|
||||||
DBG("Check /proc/self/maps for symbol=%p", symbol);
|
DBG("Check /proc/self/maps for symbol=%p", symbol);
|
||||||
while (fgets(buf, sizeof(buf), f))
|
while (fgets(buf, sizeof(buf), f))
|
||||||
{
|
{
|
||||||
int len;
|
int len;
|
||||||
char *p, mode[5] = "";
|
char *p, mode[5] = "";
|
||||||
unsigned long ptr1 = 0, ptr2 = 0;
|
unsigned long ptr1 = 0, ptr2 = 0;
|
||||||
|
|
||||||
len = strlen(buf);
|
len = strlen(buf);
|
||||||
if (buf[len - 1] == '\n')
|
if (buf[len - 1] == '\n')
|
||||||
{
|
{
|
||||||
buf[len - 1] = 0;
|
buf[len - 1] = 0;
|
||||||
len--;
|
len--;
|
||||||
}
|
}
|
||||||
if (sscanf(buf, "%lx-%lx %4s", &ptr1, &ptr2, mode) == 3)
|
if (sscanf(buf, "%lx-%lx %4s", &ptr1, &ptr2, mode) == 3)
|
||||||
{
|
{
|
||||||
if (!strcmp(mode, "r-xp"))
|
if (!strcmp(mode, "r-xp"))
|
||||||
{
|
{
|
||||||
if (((void *)ptr1 <= symbol) && (symbol < (void *)ptr2))
|
if (((void *)ptr1 <= symbol) && (symbol < (void *)ptr2))
|
||||||
{
|
{
|
||||||
p = strchr(buf, '/');
|
p = strchr(buf, '/');
|
||||||
if (p)
|
if (p)
|
||||||
{
|
{
|
||||||
if (len > 10)
|
if (len > 10)
|
||||||
{
|
{
|
||||||
if (!strcmp(buf + len - 10, " (deleted)"))
|
if (!strcmp(buf + len - 10, " (deleted)"))
|
||||||
buf[len - 10] = 0;
|
buf[len - 10] = 0;
|
||||||
}
|
}
|
||||||
STRDUP_REP(pfx->exe_path, p);
|
STRDUP_REP(pfx->exe_path, p);
|
||||||
INF("Found %p in /proc/self/maps: %s (%s)", symbol, pfx->exe_path, buf);
|
INF("Found %p in /proc/self/maps: %s (%s)", symbol, pfx->exe_path, buf);
|
||||||
fclose(f);
|
fclose(f);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
DBG("Found %p in /proc/self/maps but not a file (%s)", symbol, buf);
|
DBG("Found %p in /proc/self/maps but not a file (%s)", symbol, buf);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fclose(f);
|
fclose(f);
|
||||||
WRN("Couldn't find symbol %p in a file in /proc/self/maps", symbol);
|
WRN("Couldn't find symbol %p in a file in /proc/self/maps", symbol);
|
||||||
|
@ -637,45 +637,45 @@ eina_prefix_new(const char *argv0, void *symbol, const char *envprefix,
|
||||||
p = strrchr(pfx->exe_path, DSEP_C);
|
p = strrchr(pfx->exe_path, DSEP_C);
|
||||||
if (p)
|
if (p)
|
||||||
{
|
{
|
||||||
p--;
|
p--;
|
||||||
while (p >= pfx->exe_path)
|
while (p >= pfx->exe_path)
|
||||||
{
|
{
|
||||||
if (*p == DSEP_C)
|
if (*p == DSEP_C)
|
||||||
{
|
{
|
||||||
if (pfx->prefix_path) free(pfx->prefix_path);
|
if (pfx->prefix_path) free(pfx->prefix_path);
|
||||||
pfx->prefix_path = malloc(p - pfx->exe_path + 1);
|
pfx->prefix_path = malloc(p - pfx->exe_path + 1);
|
||||||
if (pfx->prefix_path)
|
if (pfx->prefix_path)
|
||||||
{
|
{
|
||||||
Eina_Bool magic_found = EINA_FALSE;
|
Eina_Bool magic_found = EINA_FALSE;
|
||||||
int checks_passed = 0;
|
int checks_passed = 0;
|
||||||
|
|
||||||
strncpy(pfx->prefix_path, pfx->exe_path,
|
strncpy(pfx->prefix_path, pfx->exe_path,
|
||||||
p - pfx->exe_path);
|
p - pfx->exe_path);
|
||||||
pfx->prefix_path[p - pfx->exe_path] = 0;
|
pfx->prefix_path[p - pfx->exe_path] = 0;
|
||||||
DBG("Have prefix = %s", pfx->prefix_path);
|
DBG("Have prefix = %s", pfx->prefix_path);
|
||||||
|
|
||||||
/* bin */
|
/* bin */
|
||||||
_path_join(buf, sizeof(buf), pfx->prefix_path, bindir);
|
_path_join(buf, sizeof(buf), pfx->prefix_path, bindir);
|
||||||
STRDUP_REP(pfx->prefix_path_bin, buf);
|
STRDUP_REP(pfx->prefix_path_bin, buf);
|
||||||
DBG("Have bin = %s", pfx->prefix_path_bin);
|
DBG("Have bin = %s", pfx->prefix_path_bin);
|
||||||
if ((!from_bin) && (stat(buf, &st) == 0))
|
if ((!from_bin) && (stat(buf, &st) == 0))
|
||||||
checks_passed++;
|
checks_passed++;
|
||||||
|
|
||||||
/* lib */
|
/* lib */
|
||||||
_path_join(buf, sizeof(buf), pfx->prefix_path, libdir);
|
_path_join(buf, sizeof(buf), pfx->prefix_path, libdir);
|
||||||
STRDUP_REP(pfx->prefix_path_lib, buf);
|
STRDUP_REP(pfx->prefix_path_lib, buf);
|
||||||
DBG("Have lib = %s", pfx->prefix_path_lib);
|
DBG("Have lib = %s", pfx->prefix_path_lib);
|
||||||
if ((!from_lib) && (stat(buf, &st) == 0))
|
if ((!from_lib) && (stat(buf, &st) == 0))
|
||||||
checks_passed++;
|
checks_passed++;
|
||||||
|
|
||||||
/* locale */
|
/* locale */
|
||||||
_path_join(buf, sizeof(buf), pfx->prefix_path, localedir);
|
_path_join(buf, sizeof(buf), pfx->prefix_path, localedir);
|
||||||
STRDUP_REP(pfx->prefix_path_locale, buf);
|
STRDUP_REP(pfx->prefix_path_locale, buf);
|
||||||
DBG("Have locale = %s", pfx->prefix_path_locale);
|
DBG("Have locale = %s", pfx->prefix_path_locale);
|
||||||
if (stat(buf, &st) == 0)
|
if (stat(buf, &st) == 0)
|
||||||
checks_passed++;
|
checks_passed++;
|
||||||
|
|
||||||
/* check if magic file is there - then our guess is right */
|
/* check if magic file is there - then our guess is right */
|
||||||
if (!magic)
|
if (!magic)
|
||||||
DBG("No magic file");
|
DBG("No magic file");
|
||||||
else
|
else
|
||||||
|
@ -697,13 +697,13 @@ eina_prefix_new(const char *argv0, void *symbol, const char *envprefix,
|
||||||
WRN("Missing magic path %s", buf);
|
WRN("Missing magic path %s", buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (((!magic) && (checks_passed > 0)) ||
|
if (((!magic) && (checks_passed > 0)) ||
|
||||||
((magic) && (magic_found)))
|
((magic) && (magic_found)))
|
||||||
{
|
{
|
||||||
_path_join(buf, sizeof(buf), pfx->prefix_path, datadir);
|
_path_join(buf, sizeof(buf), pfx->prefix_path, datadir);
|
||||||
STRDUP_REP(pfx->prefix_path_data, buf);
|
STRDUP_REP(pfx->prefix_path_data, buf);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
for (;p > pfx->exe_path; p--)
|
for (;p > pfx->exe_path; p--)
|
||||||
{
|
{
|
||||||
|
@ -723,17 +723,17 @@ eina_prefix_new(const char *argv0, void *symbol, const char *envprefix,
|
||||||
_fallback(pfx, pkg_bin, pkg_lib, pkg_data,
|
_fallback(pfx, pkg_bin, pkg_lib, pkg_data,
|
||||||
pkg_locale, envprefix);
|
pkg_locale, envprefix);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
WRN("No Prefix path (alloc fail)");
|
WRN("No Prefix path (alloc fail)");
|
||||||
_fallback(pfx, pkg_bin, pkg_lib, pkg_data, pkg_locale,
|
_fallback(pfx, pkg_bin, pkg_lib, pkg_data, pkg_locale,
|
||||||
envprefix);
|
envprefix);
|
||||||
}
|
}
|
||||||
return pfx;
|
return pfx;
|
||||||
}
|
}
|
||||||
p--;
|
p--;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
WRN("Final fallback");
|
WRN("Final fallback");
|
||||||
_fallback(pfx, pkg_bin, pkg_lib, pkg_data, pkg_locale, envprefix);
|
_fallback(pfx, pkg_bin, pkg_lib, pkg_data, pkg_locale, envprefix);
|
||||||
|
|
Loading…
Reference in New Issue