https://github.com/git/git
Revision 1e102bf7c83281944ffd9202a7d35c514e4a5644 authored by Junio C Hamano on 17 July 2008, 05:42:04 UTC, committed by Junio C Hamano on 17 July 2008, 05:42:04 UTC
A patch title "[PATCH] 1" was sanitized by the original code by stripping
the "[PATCH]" from the front, but after the conversion to use strbuf this
behaviour was broken due to a counting error.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 3bf0dd1
Raw File
Tip revision: 1e102bf7c83281944ffd9202a7d35c514e4a5644 authored by Junio C Hamano on 17 July 2008, 05:42:04 UTC
mailinfo: off-by-one fix for [PATCH (foobar)] removal from Subject: line
Tip revision: 1e102bf
path-list.h
#ifndef PATH_LIST_H
#define PATH_LIST_H

struct path_list_item {
	char *path;
	void *util;
};
struct path_list
{
	struct path_list_item *items;
	unsigned int nr, alloc;
	unsigned int strdup_paths:1;
};

void print_path_list(const char *text, const struct path_list *p);
void path_list_clear(struct path_list *list, int free_util);

/* Use these functions only on sorted lists: */
int path_list_has_path(const struct path_list *list, const char *path);
struct path_list_item *path_list_insert(const char *path, struct path_list *list);
struct path_list_item *path_list_lookup(const char *path, struct path_list *list);

/* Use these functions only on unsorted lists: */
struct path_list_item *path_list_append(const char *path, struct path_list *list);
void sort_path_list(struct path_list *list);
int unsorted_path_list_has_path(struct path_list *list, const char *path);

#endif /* PATH_LIST_H */
back to top