ObjFW  Diff

Differences From Artifact [e3697eafac]:

To Artifact [10ad5c2607]:


72
73
74
75
76
77
78





79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
}

@implementation OFEmbeddedFileURLHandler
- (OFStream *)openItemAtURL: (OFURL *)URL mode: (OFString *)mode
{
	const char *path;






	if (![mode isEqual: @"r"])
		@throw [OFOpenItemFailedException exceptionWithURL: URL
							      mode: mode
							     errNo: EROFS];

	if (URL.host != nil || URL.port != nil || URL.user != nil ||
	    URL.password != nil || URL.query != nil || URL.fragment != nil)
		@throw [OFInvalidArgumentException exception];

	if ((path = URL.path.UTF8String) == NULL) {
		@throw [OFInvalidArgumentException exception];
	}

#ifdef OF_HAVE_THREADS
	OFEnsure(OFPlainMutexLock(&mutex) == 0);
	@try {







>
>
>
>
>





<
<
<
<







72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88




89
90
91
92
93
94
95
}

@implementation OFEmbeddedFileURLHandler
- (OFStream *)openItemAtURL: (OFURL *)URL mode: (OFString *)mode
{
	const char *path;

	if (![URL.scheme isEqual: @"objfw-embedded"] || URL.host != nil ||
	    URL.port != nil || URL.user != nil || URL.password != nil ||
	    URL.query != nil || URL.fragment != nil)
		@throw [OFInvalidArgumentException exception];

	if (![mode isEqual: @"r"])
		@throw [OFOpenItemFailedException exceptionWithURL: URL
							      mode: mode
							     errNo: EROFS];





	if ((path = URL.path.UTF8String) == NULL) {
		@throw [OFInvalidArgumentException exception];
	}

#ifdef OF_HAVE_THREADS
	OFEnsure(OFPlainMutexLock(&mutex) == 0);
	@try {