ObjFW  Diff

Differences From Artifact [26fa9bdcde]:

To Artifact [5eea787dbf]:


35
36
37
38
39
40
41
42

43
44
45
46
47
48
49
35
36
37
38
39
40
41

42
43
44
45
46
47
48
49







-
+







- (instancetype)initWithFileName: (OFString *)fileName
{
	self = [super of_init];

	@try {
		void *pool = objc_autoreleasePoolPush();

		_fileName = [fileName copy];
		self.fileName = fileName;
		self.modificationDate = [OFDate date];

		objc_autoreleasePoolPop(pool);
	} @catch (id e) {
		[self release];
		@throw e;
	}
125
126
127
128
129
130
131



132
133
134














135
136
137





138
139
140
141
142
143
144
125
126
127
128
129
130
131
132
133
134



135
136
137
138
139
140
141
142
143
144
145
146
147
148
149


150
151
152
153
154
155
156
157
158
159
160
161







+
+
+
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+

-
-
+
+
+
+
+







	OFString *old = _fileComment;
	_fileComment = [fileComment copy];
	[old release];
}

- (void)setFileName: (OFString *)fileName
{
	void *pool = objc_autoreleasePoolPush();
	OFString *oldFileName = _fileName, *oldDirectoryName = _directoryName;
	size_t lastSlash;
	OFString *old = _fileName;
	_fileName = [fileName copy];
	[old release];

	lastSlash = [fileName rangeOfString: @"/"
				    options: OFStringSearchBackwards].location;
	if (lastSlash != OFNotFound) {
		_fileName = [[fileName substringWithRange: OFMakeRange(
		    lastSlash + 1, fileName.length - lastSlash - 1)] copy];
		[oldFileName release];

		_directoryName = [[fileName substringWithRange:
		    OFMakeRange(0, lastSlash)] copy];
		[oldDirectoryName release];
	} else {
		_fileName = [fileName copy];
		[oldFileName release];

	[_directoryName release];
	_directoryName = nil;
		[_directoryName release];
		_directoryName = nil;
	}

	objc_autoreleasePoolPop(pool);
}

- (void)setOperatingSystemIdentifier: (uint16_t)operatingSystemIdentifier
{
	_operatingSystemIdentifier = operatingSystemIdentifier;
}