Change-Id: I0afbb7d946d16b2fff293c8697ae2e6d7db53e43
return (string_len >= suffix_len) && !strcmp(string + string_len - suffix_len, suffix);
}
+/* what for: kernel.core_pattern's %E replaces / with !, this function does opposite process */
+void kernel_exe_path_normalize(char *path)
+{
+ assert(path);
+
+ for (size_t i = 0, len = strlen(path); i < len; i++)
+ path[i] = path[i] == '!' ? '/' : path[i];
+}
+
bool file_exists(const char *path)
{
struct stat buf;
bool string_ends_with(const char *string, const char *suffix);
+void kernel_exe_path_normalize(char *path);
+
bool file_exists(const char *path);
bool file_exists_in_dir(const char *dir_path, const char *file_name);