/* Check if there is any duplicate of the current setting. 
This function checks if there is any duplicated data further in the buffer. */
static bool settings_file_check_duplicate(const struct line_entry_ctx *entry_ctx, const char *const name)
/* Check if there is any duplicate of the current setting. 
This function checks if there is any duplicated data further in the buffer. */
static bool settings_file_check_duplicate(const struct line_entry_ctx *entry_ctx, const char *const name)
{
	struct line_entry_ctx entry2_ctx = *entry_ctx;
	while (settings_next_line_ctx(&entry2_ctx) == 0) {
		char name2[SETTINGS_MAX_NAME_LEN + SETTINGS_EXTRA_LEN + 1];
		size_t name2_len;
		if (entry2_ctx.len == 0) {
			break;
		}
		if (settings_line_name_read(name2, sizeof(name2), &name2_len,
					    &entry2_ctx)) {
			continue;
		}
		name2[name2_len] = '\0';
		if (!strcmp(name, name2)) {
			return true;
		}
	}
	return false;
}