Staging
v0.5.2
https://github.com/git/git
Revision d3ac8c3f27a507d0489d18b51d6deba6364a99ce authored by Johannes Schindelin on 04 December 2019, 20:26:31 UTC, committed by Johannes Schindelin on 06 December 2019, 15:26:55 UTC
* maint-2.14: (28 commits)
  Git 2.14.6
  mingw: handle `subst`-ed "DOS drives"
  mingw: refuse to access paths with trailing spaces or periods
  mingw: refuse to access paths with illegal characters
  unpack-trees: let merged_entry() pass through do_add_entry()'s errors
  quote-stress-test: offer to test quoting arguments for MSYS2 sh
  t6130/t9350: prepare for stringent Win32 path validation
  quote-stress-test: allow skipping some trials
  quote-stress-test: accept arguments to test via the command-line
  tests: add a helper to stress test argument quoting
  mingw: fix quoting of arguments
  Disallow dubiously-nested submodule git directories
  protect_ntfs: turn on NTFS protection by default
  path: also guard `.gitmodules` against NTFS Alternate Data Streams
  is_ntfs_dotgit(): speed it up
  mingw: disallow backslash characters in tree objects' file names
  path: safeguard `.git` against NTFS Alternate Streams Accesses
  clone --recurse-submodules: prevent name squatting on Windows
  is_ntfs_dotgit(): only verify the leading segment
  test-path-utils: offer to run a protectNTFS/protectHFS benchmark
  ...
2 parent s 924c623 + 66d2a61
Raw File
Tip revision: d3ac8c3f27a507d0489d18b51d6deba6364a99ce authored by Johannes Schindelin on 04 December 2019, 20:26:31 UTC
Sync with 2.14.6
Tip revision: d3ac8c3
urlmatch.h
#ifndef URL_MATCH_H
#include "string-list.h"

struct url_info {
	/* normalized url on success, must be freed, otherwise NULL */
	char *url;
	/* if !url, a brief reason for the failure, otherwise NULL */
	const char *err;

	/* the rest of the fields are only set if url != NULL */

	size_t url_len;		/* total length of url (which is now normalized) */
	size_t scheme_len;	/* length of scheme name (excluding final :) */
	size_t user_off;	/* offset into url to start of user name (0 => none) */
	size_t user_len;	/* length of user name; if user_off != 0 but
				   user_len == 0, an empty user name was given */
	size_t passwd_off;	/* offset into url to start of passwd (0 => none) */
	size_t passwd_len;	/* length of passwd; if passwd_off != 0 but
				   passwd_len == 0, an empty passwd was given */
	size_t host_off;	/* offset into url to start of host name (0 => none) */
	size_t host_len;	/* length of host name;
				 * file urls may have host_len == 0 */
	size_t port_off;	/* offset into url to start of port number (0 => none) */
	size_t port_len;	/* if a portnum is present (port_off != 0), it has
				 * this length (excluding the leading ':') starting
				 * from port_off (always 0 for file urls) */
	size_t path_off;	/* offset into url to the start of the url path;
				 * this will always point to a '/' character
				 * after the url has been normalized */
	size_t path_len;	/* length of path portion excluding any trailing
				 * '?...' and '#...' portion; will always be >= 1 */
};

extern char *url_normalize(const char *, struct url_info *);

struct urlmatch_item {
	size_t hostmatch_len;
	size_t pathmatch_len;
	char user_matched;
};

struct urlmatch_config {
	struct string_list vars;
	struct url_info url;
	const char *section;
	const char *key;

	void *cb;
	int (*collect_fn)(const char *var, const char *value, void *cb);
	int (*cascade_fn)(const char *var, const char *value, void *cb);
};

extern int urlmatch_config_entry(const char *var, const char *value, void *cb);

#endif /* URL_MATCH_H */
back to top