ObjFW  Diff

Differences From Artifact [cca222946b]:

To Artifact [95256ec388]:


1973
1974
1975
1976
1977
1978
1979
1980

1981
1982
1983
1984
1985
1986
1987
1988

1989
1990
1991
1992
1993
1994
1995
1973
1974
1975
1976
1977
1978
1979

1980
1981
1982
1983
1984
1985
1986
1987

1988
1989
1990
1991
1992
1993
1994
1995







-
+







-
+







	if (length == 0)
		return ret;

	pool = objc_autoreleasePoolPush();

	characters = [self characters];

#ifndef _WIN32
#if !defined(_WIN32) && !defined(__DJGPP__)
	if (characters[length - 1] == OF_PATH_DELIMITER)
#else
	if (characters[length - 1] == '/' || characters[length - 1] == '\\')
#endif
		length--;

	for (i = 0; i < length; i++) {
#ifndef _WIN32
#if !defined(_WIN32) && !defined(__DJGPP__)
		if (characters[i] == OF_PATH_DELIMITER) {
#else
		if (characters[i] == '/' || characters[i] == '\\') {
#endif
			[ret addObject: [self substringWithRange:
			    of_range(last, i - last)]];

2016
2017
2018
2019
2020
2021
2022
2023

2024
2025
2026
2027
2028
2029
2030
2031

2032
2033
2034
2035
2036
2037
2038
2016
2017
2018
2019
2020
2021
2022

2023
2024
2025
2026
2027
2028
2029
2030

2031
2032
2033
2034
2035
2036
2037
2038







-
+







-
+







	if (length == 0)
		return @"";

	pool = objc_autoreleasePoolPush();

	characters = [self characters];

#ifndef _WIN32
#if !defined(_WIN32) && !defined(__DJGPP__)
	if (characters[length - 1] == OF_PATH_DELIMITER)
#else
	if (characters[length - 1] == '/' || characters[length - 1] == '\\')
#endif
		length--;

	for (i = length - 1; i >= 0; i--) {
#ifndef _WIN32
#if !defined(_WIN32) && !defined(__DJGPP__)
		if (characters[i] == OF_PATH_DELIMITER) {
#else
		if (characters[i] == '/' || characters[i] == '\\') {
#endif
			i++;
			break;
		}
2079
2080
2081
2082
2083
2084
2085
2086

2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099

2100
2101
2102
2103
2104
2105
2106
2107
2108
2109

2110
2111
2112
2113
2114
2115
2116
2079
2080
2081
2082
2083
2084
2085

2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098

2099
2100
2101
2102
2103
2104
2105
2106
2107
2108

2109
2110
2111
2112
2113
2114
2115
2116







-
+












-
+









-
+







	if (length == 0)
		return @"";

	pool = objc_autoreleasePoolPush();

	characters = [self characters];

#ifndef _WIN32
#if !defined(_WIN32) && !defined(__DJGPP__)
	if (characters[length - 1] == OF_PATH_DELIMITER)
#else
	if (characters[length - 1] == '/' || characters[length - 1] == '\\')
#endif
		length--;

	if (length == 0) {
		objc_autoreleasePoolPop(pool);
		return [self substringWithRange: of_range(0, 1)];
	}

	for (i = length - 1; i >= 1; i--) {
#ifndef _WIN32
#if !defined(_WIN32) && !defined(__DJGPP__)
		if (characters[i] == OF_PATH_DELIMITER) {
#else
		if (characters[i] == '/' || characters[i] == '\\') {
#endif
			objc_autoreleasePoolPop(pool);
			return [self substringWithRange: of_range(0, i)];
		}
	}

#ifndef _WIN32
#if !defined(_WIN32) && !defined(__DJGPP__)
	if (characters[0] == OF_PATH_DELIMITER) {
#else
	if (characters[0] == '/' || characters[0] == '\\') {
#endif
		objc_autoreleasePoolPop(pool);
		return [self substringWithRange: of_range(0, 1)];
	}