Fossil SCM

The UrlData.path element should always be dynamically allocated.

drh 2021-10-26 15:13 trunk
Commit b9c9d39df94f0af185bbca8566a97c5170debb2c2a71c46aab242c916fa4a413
1 file changed +1 -1
+1 -1
--- src/url.c
+++ src/url.c
@@ -280,11 +280,11 @@
280280
dehttpize(zFile);
281281
file_canonical_name(zFile, &cfile, 0);
282282
free(zFile);
283283
zFile = 0;
284284
pUrlData->protocol = "file";
285
- pUrlData->path = "";
285
+ pUrlData->path = mprintf("");
286286
pUrlData->name = mprintf("%b", &cfile);
287287
pUrlData->canonical = mprintf("file://%T", pUrlData->name);
288288
blob_reset(&cfile);
289289
}else if( pUrlData->user!=0 && pUrlData->passwd==0
290290
&& (urlFlags & URL_PROMPT_PW)!=0 ){
291291
--- src/url.c
+++ src/url.c
@@ -280,11 +280,11 @@
280 dehttpize(zFile);
281 file_canonical_name(zFile, &cfile, 0);
282 free(zFile);
283 zFile = 0;
284 pUrlData->protocol = "file";
285 pUrlData->path = "";
286 pUrlData->name = mprintf("%b", &cfile);
287 pUrlData->canonical = mprintf("file://%T", pUrlData->name);
288 blob_reset(&cfile);
289 }else if( pUrlData->user!=0 && pUrlData->passwd==0
290 && (urlFlags & URL_PROMPT_PW)!=0 ){
291
--- src/url.c
+++ src/url.c
@@ -280,11 +280,11 @@
280 dehttpize(zFile);
281 file_canonical_name(zFile, &cfile, 0);
282 free(zFile);
283 zFile = 0;
284 pUrlData->protocol = "file";
285 pUrlData->path = mprintf("");
286 pUrlData->name = mprintf("%b", &cfile);
287 pUrlData->canonical = mprintf("file://%T", pUrlData->name);
288 blob_reset(&cfile);
289 }else if( pUrlData->user!=0 && pUrlData->passwd==0
290 && (urlFlags & URL_PROMPT_PW)!=0 ){
291

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button