git-2.22.0/utf8.c
/*
 * Pick the next char from the stream, ignoring codepoints an HFS+ would.
 * Note that this is _not_ complete by any means. It's just enough
 * to make is_hfs_dotgit() work, and should not be used otherwise.
 */
Pick the next char from the stream, ignoring codepoints an HFS+ would.
Note that this is _not_ complete by any means. It's just enough
to make is_hfs_dotgit() work, and should not be used otherwise.
Pick the next char from the stream ignoring codepoints an HFS + would . Note that this is _not_ complete by any means . It ' s just enough to make is_hfs_dotgit () work and should not be used otherwise .
static ucs_char_t next_hfs_char(const char **in)
{
	while (1) {
		ucs_char_t out = pick_one_utf8_char(in, NULL);
		if (!*in)
			return 0;
		switch (out) {
		case 0x200c: 
		case 0x200d: 
		case 0x200e: 
		case 0x200f: 
		case 0x202a: 
		case 0x202b: 
		case 0x202c: 
		case 0x202d: 
		case 0x202e: 
		case 0x206a: 
		case 0x206b: 
		case 0x206c: 
		case 0x206d: 
		case 0x206e: 
		case 0x206f: 
		case 0xfeff: 
			continue;
		}
		return out;
	}
}
static ucs_char_t next_hfs_char ( const char * * in ) { while ( 1 ) { ucs_char_t out = pick_one_utf8_char ( in , NULL ) ; if ( ! * in ) return 0 ; switch ( out ) { case 0x200c : case 0x200d : case 0x200e : case 0x200f : case 0x202a : case 0x202b : case 0x202c : case 0x202d : case 0x202e : case 0x206a : case 0x206b : case 0x206c : case 0x206d : case 0x206e : case 0x206f : case 0xfeff : continue ; } return out ; } }
Pick the next char from the stream, ignoring codepoints an HFS+ would.
Pick the next char from the stream ignoring codepoints an HFS + would .
/*
		 * check for malformed utf8. Technically this
		 * gets converted to a percent-sequence, but
		 * returning 0 is good enough for is_hfs_dotgit
		 * to realize it cannot be .git
		 */ /* these code points are ignored completely */ /* ZERO WIDTH NON-JOINER */ /* ZERO WIDTH JOINER */ /* LEFT-TO-RIGHT MARK */ /* RIGHT-TO-LEFT MARK */ /* LEFT-TO-RIGHT EMBEDDING */ /* RIGHT-TO-LEFT EMBEDDING */ /* POP DIRECTIONAL FORMATTING */ /* LEFT-TO-RIGHT OVERRIDE */ /* RIGHT-TO-LEFT OVERRIDE */ /* INHIBIT SYMMETRIC SWAPPING */ /* ACTIVATE SYMMETRIC SWAPPING */ /* INHIBIT ARABIC FORM SHAPING */ /* ACTIVATE ARABIC FORM SHAPING */ /* NATIONAL DIGIT SHAPES */ /* NOMINAL DIGIT SHAPES */ /* ZERO WIDTH NO-BREAK SPACE */