ObjFW  Check-in [775d6b52a5]

Overview
Comment:-[OFString lastPathComponent]: Return @"" for /
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 775d6b52a5aacffee0a5c39d463805df28ef02d3eb0f046aa98074aed2838af9
User & Date: js on 2015-01-29 20:58:06
Other Links: manifest | tags
Context
2015-01-29
21:25
OF_RO[LR]: Correctly handle bits % sizeof * 8 == 0 check-in: ee4b0920da user: js tags: trunk
20:58
-[OFString lastPathComponent]: Return @"" for / check-in: 775d6b52a5 user: js tags: trunk
2015-01-20
19:38
tests: Class and category name consistency check-in: ea500c31be user: js tags: trunk
Changes

Modified src/OFString.m from [b444f3a688] to [e0dd905710].

1993
1994
1995
1996
1997
1998
1999






2000
2001
2002
2003
2004
2005
2006
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012







+
+
+
+
+
+








	pool = objc_autoreleasePoolPush();

	characters = [self characters];

	if (OF_IS_PATH_DELIMITER(characters[length - 1]))
		length--;

	if (length == 0) {
		objc_autoreleasePoolPop(pool);

		return @"";
	}

	for (i = length - 1; i >= 0; i--) {
		if (OF_IS_PATH_DELIMITER(characters[i])) {
			i++;
			break;
		}
	}

Modified src/OFString_UTF8.m from [4d0413d200] to [f9a61670cf].

1123
1124
1125
1126
1127
1128
1129



1130
1131
1132
1133
1134
1135
1136
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139







+
+
+







	ssize_t i;

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

	if (OF_IS_PATH_DELIMITER(_s->cString[pathCStringLength - 1]))
		pathCStringLength--;

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

	for (i = pathCStringLength - 1; i >= 0; i--) {
		if (OF_IS_PATH_DELIMITER(_s->cString[i])) {
			i++;
			break;
		}
	}