Fossil SCM
Fixed a double-free caused by refactoring. Was being triggered in web mode but not CLI mode, strangely enough, though the code was hit by both. Other minor cleanups and fixes.
Commit
6f749dfbc8ec5d3c80678a872687fd05cd246cccf36dc5646ba72b115fe1f099
Parent
2ee462843a97740…
1 file changed
+19
-14
+19
-14
| --- src/checkin.c | ||
| +++ src/checkin.c | ||
| @@ -2831,14 +2831,14 @@ | ||
| 2831 | 2831 | blob_reset(&p->fileHash); |
| 2832 | 2832 | if(p->pParent){ |
| 2833 | 2833 | manifest_destroy(p->pParent); |
| 2834 | 2834 | } |
| 2835 | 2835 | fossil_free(p->zFilename); |
| 2836 | - fossil_free(p->zMimetype); | |
| 2836 | + fossil_free(p->zDate); | |
| 2837 | 2837 | fossil_free(p->zParentUuid); |
| 2838 | + fossil_free(p->zMimetype); | |
| 2838 | 2839 | fossil_free(p->zUser); |
| 2839 | - fossil_free(p->zDate); | |
| 2840 | 2840 | CheckinMiniInfo_init(p); |
| 2841 | 2841 | } |
| 2842 | 2842 | |
| 2843 | 2843 | /* |
| 2844 | 2844 | ** Internal helper which returns an F-card perms string suitable for |
| @@ -3039,11 +3039,11 @@ | ||
| 3039 | 3039 | if(blob_size(&pCI->comment)!=0){ |
| 3040 | 3040 | blob_appendf(pOut, "C %F\n", blob_str(&pCI->comment)); |
| 3041 | 3041 | }else{ |
| 3042 | 3042 | blob_append(pOut, "C (no\\scomment)\n", 16); |
| 3043 | 3043 | } |
| 3044 | - blob_appendf(pOut, "D %z\n", pCI->zDate); | |
| 3044 | + blob_appendf(pOut, "D %s\n", pCI->zDate); | |
| 3045 | 3045 | if(create_manifest_mini_fcards(pOut,pCI,asDelta,pErr)==0){ |
| 3046 | 3046 | return 0; |
| 3047 | 3047 | } |
| 3048 | 3048 | if(pCI->zMimetype!=0 && pCI->zMimetype[0]!=0){ |
| 3049 | 3049 | blob_appendf(pOut, "N %F\n", pCI->zMimetype); |
| @@ -3133,11 +3133,11 @@ | ||
| 3133 | 3133 | } |
| 3134 | 3134 | fossil_free(zProjCode); |
| 3135 | 3135 | } |
| 3136 | 3136 | db_begin_transaction(); |
| 3137 | 3137 | |
| 3138 | - if(pCI->pParent==0 && pCI->zParentUuid){ | |
| 3138 | + if(pCI->pParent==0 && pCI->zParentUuid==0){ | |
| 3139 | 3139 | ci_err((pErr, "Cannot determine parent version.")); |
| 3140 | 3140 | } |
| 3141 | 3141 | else if(pCI->pParent==0){ |
| 3142 | 3142 | pCI->pParent = manifest_get_by_name(pCI->zParentUuid, 0); |
| 3143 | 3143 | if(pCI->pParent==0){ |
| @@ -3667,11 +3667,10 @@ | ||
| 3667 | 3667 | const char * zRev = P("r"); /* checkin version */ |
| 3668 | 3668 | const char * zContent = P("content"); /* file content */ |
| 3669 | 3669 | const char * zComment = P("comment"); /* checkin comment */ |
| 3670 | 3670 | CheckinMiniInfo cimi; /* Checkin state */ |
| 3671 | 3671 | int submitMode = 0; /* See mapping below */ |
| 3672 | - char * zRevResolved = 0; /* Resolved zRev */ | |
| 3673 | 3672 | int vid, newVid = 0; /* checkin rid */ |
| 3674 | 3673 | char * zFileUuid = 0; /* File content UUID */ |
| 3675 | 3674 | int frid = 0; /* File content rid */ |
| 3676 | 3675 | Blob err = empty_blob; /* Error report */ |
| 3677 | 3676 | const char * zFlagCheck = 0; /* Temp url flag holder */ |
| @@ -3722,11 +3721,11 @@ | ||
| 3722 | 3721 | if(0==vid){ |
| 3723 | 3722 | fail((&err,"Could not resolve checkin version.")); |
| 3724 | 3723 | } |
| 3725 | 3724 | |
| 3726 | 3725 | /* Find the repo-side file entry or fail... */ |
| 3727 | - zRevResolved = rid_to_uuid(vid); | |
| 3726 | + cimi.zParentUuid = rid_to_uuid(vid); | |
| 3728 | 3727 | db_prepare(&stmt, "SELECT uuid, perm FROM files_of_checkin " |
| 3729 | 3728 | "WHERE filename=%Q %s AND checkinID=%d", |
| 3730 | 3729 | zFilename, filename_collation(), vid); |
| 3731 | 3730 | if(SQLITE_ROW==db_step(&stmt)){ |
| 3732 | 3731 | const char * zPerm = db_column_text(&stmt, 1); |
| @@ -3737,11 +3736,12 @@ | ||
| 3737 | 3736 | zFileUuid = mprintf("%s",db_column_text(&stmt, 0)); |
| 3738 | 3737 | } |
| 3739 | 3738 | db_finalize(&stmt); |
| 3740 | 3739 | if(!zFileUuid){ |
| 3741 | 3740 | fail((&err,"Checkin [%S] does not contain file: " |
| 3742 | - "<code>%h</code>", zRevResolved, zFilename)); | |
| 3741 | + "<code>%h</code>", | |
| 3742 | + cimi.zParentUuid, zFilename)); | |
| 3743 | 3743 | } |
| 3744 | 3744 | frid = fast_uuid_to_rid(zFileUuid); |
| 3745 | 3745 | assert(frid); |
| 3746 | 3746 | |
| 3747 | 3747 | /* Read file content from submit request or repo... */ |
| @@ -3763,25 +3763,29 @@ | ||
| 3763 | 3763 | |
| 3764 | 3764 | fp("<h1>Editing:</h1>"); |
| 3765 | 3765 | fp("<p class='fileedit-hint'>"); |
| 3766 | 3766 | fp("File: <code>%h</code><br>" |
| 3767 | 3767 | "Version: <code id='r-label'>%s</code><br>", |
| 3768 | - zFilename, zRevResolved); | |
| 3768 | + zFilename, cimi.zParentUuid); | |
| 3769 | 3769 | fp("Permalink: <code>" |
| 3770 | 3770 | "<a id='permalink' href='%R/fileedit?file=%T&r=%!S'>" |
| 3771 | 3771 | "/fileedit?file=%T&r=%!S</a></code><br>" |
| 3772 | 3772 | "(Clicking the permalink will reload the page and discard " |
| 3773 | 3773 | "all edits!)", |
| 3774 | - zFilename, zRevResolved, zFilename, zRevResolved); | |
| 3774 | + zFilename, cimi.zParentUuid, | |
| 3775 | + zFilename, cimi.zParentUuid); | |
| 3775 | 3776 | fp("</p>"); |
| 3776 | - fp("<p>This page is <em>far from complete</em>.</p>\n"); | |
| 3777 | + fp("<p>This page is <em>far from complete</em> and may still have " | |
| 3778 | + "significant bugs. USE AT YOUR OWN RISK, preferably on a test " | |
| 3779 | + "repo.</p>\n"); | |
| 3777 | 3780 | |
| 3778 | 3781 | fp("<form action='%R/fileedit' method='POST' " |
| 3779 | 3782 | "class='fileedit-form'>\n"); |
| 3780 | 3783 | |
| 3781 | 3784 | /******* Hidden fields *******/ |
| 3782 | - fp("<input type='hidden' name='r' value='%s'>", zRevResolved); | |
| 3785 | + fp("<input type='hidden' name='r' value='%s'>", | |
| 3786 | + cimi.zParentUuid); | |
| 3783 | 3787 | fp("<input type='hidden' name='file' value='%T'>", |
| 3784 | 3788 | zFilename); |
| 3785 | 3789 | |
| 3786 | 3790 | /******* Comment *******/ |
| 3787 | 3791 | fp("<h3>Checkin Comment</h3>\n"); |
| @@ -3924,12 +3928,12 @@ | ||
| 3924 | 3928 | if(zComment && *zComment){ |
| 3925 | 3929 | blob_append(&cimi.comment, zComment, -1); |
| 3926 | 3930 | }else{ |
| 3927 | 3931 | fail((&err,"Empty comment is not permitted.")); |
| 3928 | 3932 | } |
| 3929 | - cimi.pParent = manifest_get(vid, CFTYPE_MANIFEST, 0); | |
| 3930 | - assert(cimi.pParent && "We know vid is valid."); | |
| 3933 | + /*cimi.pParent = manifest_get(vid, CFTYPE_MANIFEST, 0); | |
| 3934 | + assert(cimi.pParent && "We know vid is valid.");*/ | |
| 3931 | 3935 | cimi.zFilename = mprintf("%s",zFilename); |
| 3932 | 3936 | cimi.pMfOut = &manifest; |
| 3933 | 3937 | checkin_mini(&cimi, &newVid, &err); |
| 3934 | 3938 | if(newVid!=0){ |
| 3935 | 3939 | zNewUuid = rid_to_uuid(newVid); |
| @@ -3963,13 +3967,15 @@ | ||
| 3963 | 3967 | "link.innerText=urlShort;\n" |
| 3964 | 3968 | "link.setAttribute('href',urlFull);\n", |
| 3965 | 3969 | zFilename, zNewUuid, zFilename, zNewUuid); |
| 3966 | 3970 | } |
| 3967 | 3971 | fossil_free(zNewUuid); |
| 3972 | + zNewUuid = 0; | |
| 3968 | 3973 | } |
| 3969 | 3974 | /* On error, the error message is in the err blob and will |
| 3970 | 3975 | ** be emitted below. */ |
| 3976 | + cimi.pMfOut = 0; | |
| 3971 | 3977 | blob_reset(&manifest); |
| 3972 | 3978 | }else if(2==submitMode/*preview*/){ |
| 3973 | 3979 | /* TODO */ |
| 3974 | 3980 | fail((&err,"Preview mode is still TODO.")); |
| 3975 | 3981 | }else if(3==submitMode/*diff*/){ |
| @@ -3979,11 +3985,10 @@ | ||
| 3979 | 3985 | goto end_footer; |
| 3980 | 3986 | } |
| 3981 | 3987 | |
| 3982 | 3988 | end_footer: |
| 3983 | 3989 | zContent = 0; |
| 3984 | - fossil_free(zRevResolved); | |
| 3985 | 3990 | fossil_free(zFileUuid); |
| 3986 | 3991 | if(stmt.pStmt){ |
| 3987 | 3992 | db_finalize(&stmt); |
| 3988 | 3993 | } |
| 3989 | 3994 | if(blob_size(&err)){ |
| 3990 | 3995 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -2831,14 +2831,14 @@ | |
| 2831 | blob_reset(&p->fileHash); |
| 2832 | if(p->pParent){ |
| 2833 | manifest_destroy(p->pParent); |
| 2834 | } |
| 2835 | fossil_free(p->zFilename); |
| 2836 | fossil_free(p->zMimetype); |
| 2837 | fossil_free(p->zParentUuid); |
| 2838 | fossil_free(p->zUser); |
| 2839 | fossil_free(p->zDate); |
| 2840 | CheckinMiniInfo_init(p); |
| 2841 | } |
| 2842 | |
| 2843 | /* |
| 2844 | ** Internal helper which returns an F-card perms string suitable for |
| @@ -3039,11 +3039,11 @@ | |
| 3039 | if(blob_size(&pCI->comment)!=0){ |
| 3040 | blob_appendf(pOut, "C %F\n", blob_str(&pCI->comment)); |
| 3041 | }else{ |
| 3042 | blob_append(pOut, "C (no\\scomment)\n", 16); |
| 3043 | } |
| 3044 | blob_appendf(pOut, "D %z\n", pCI->zDate); |
| 3045 | if(create_manifest_mini_fcards(pOut,pCI,asDelta,pErr)==0){ |
| 3046 | return 0; |
| 3047 | } |
| 3048 | if(pCI->zMimetype!=0 && pCI->zMimetype[0]!=0){ |
| 3049 | blob_appendf(pOut, "N %F\n", pCI->zMimetype); |
| @@ -3133,11 +3133,11 @@ | |
| 3133 | } |
| 3134 | fossil_free(zProjCode); |
| 3135 | } |
| 3136 | db_begin_transaction(); |
| 3137 | |
| 3138 | if(pCI->pParent==0 && pCI->zParentUuid){ |
| 3139 | ci_err((pErr, "Cannot determine parent version.")); |
| 3140 | } |
| 3141 | else if(pCI->pParent==0){ |
| 3142 | pCI->pParent = manifest_get_by_name(pCI->zParentUuid, 0); |
| 3143 | if(pCI->pParent==0){ |
| @@ -3667,11 +3667,10 @@ | |
| 3667 | const char * zRev = P("r"); /* checkin version */ |
| 3668 | const char * zContent = P("content"); /* file content */ |
| 3669 | const char * zComment = P("comment"); /* checkin comment */ |
| 3670 | CheckinMiniInfo cimi; /* Checkin state */ |
| 3671 | int submitMode = 0; /* See mapping below */ |
| 3672 | char * zRevResolved = 0; /* Resolved zRev */ |
| 3673 | int vid, newVid = 0; /* checkin rid */ |
| 3674 | char * zFileUuid = 0; /* File content UUID */ |
| 3675 | int frid = 0; /* File content rid */ |
| 3676 | Blob err = empty_blob; /* Error report */ |
| 3677 | const char * zFlagCheck = 0; /* Temp url flag holder */ |
| @@ -3722,11 +3721,11 @@ | |
| 3722 | if(0==vid){ |
| 3723 | fail((&err,"Could not resolve checkin version.")); |
| 3724 | } |
| 3725 | |
| 3726 | /* Find the repo-side file entry or fail... */ |
| 3727 | zRevResolved = rid_to_uuid(vid); |
| 3728 | db_prepare(&stmt, "SELECT uuid, perm FROM files_of_checkin " |
| 3729 | "WHERE filename=%Q %s AND checkinID=%d", |
| 3730 | zFilename, filename_collation(), vid); |
| 3731 | if(SQLITE_ROW==db_step(&stmt)){ |
| 3732 | const char * zPerm = db_column_text(&stmt, 1); |
| @@ -3737,11 +3736,12 @@ | |
| 3737 | zFileUuid = mprintf("%s",db_column_text(&stmt, 0)); |
| 3738 | } |
| 3739 | db_finalize(&stmt); |
| 3740 | if(!zFileUuid){ |
| 3741 | fail((&err,"Checkin [%S] does not contain file: " |
| 3742 | "<code>%h</code>", zRevResolved, zFilename)); |
| 3743 | } |
| 3744 | frid = fast_uuid_to_rid(zFileUuid); |
| 3745 | assert(frid); |
| 3746 | |
| 3747 | /* Read file content from submit request or repo... */ |
| @@ -3763,25 +3763,29 @@ | |
| 3763 | |
| 3764 | fp("<h1>Editing:</h1>"); |
| 3765 | fp("<p class='fileedit-hint'>"); |
| 3766 | fp("File: <code>%h</code><br>" |
| 3767 | "Version: <code id='r-label'>%s</code><br>", |
| 3768 | zFilename, zRevResolved); |
| 3769 | fp("Permalink: <code>" |
| 3770 | "<a id='permalink' href='%R/fileedit?file=%T&r=%!S'>" |
| 3771 | "/fileedit?file=%T&r=%!S</a></code><br>" |
| 3772 | "(Clicking the permalink will reload the page and discard " |
| 3773 | "all edits!)", |
| 3774 | zFilename, zRevResolved, zFilename, zRevResolved); |
| 3775 | fp("</p>"); |
| 3776 | fp("<p>This page is <em>far from complete</em>.</p>\n"); |
| 3777 | |
| 3778 | fp("<form action='%R/fileedit' method='POST' " |
| 3779 | "class='fileedit-form'>\n"); |
| 3780 | |
| 3781 | /******* Hidden fields *******/ |
| 3782 | fp("<input type='hidden' name='r' value='%s'>", zRevResolved); |
| 3783 | fp("<input type='hidden' name='file' value='%T'>", |
| 3784 | zFilename); |
| 3785 | |
| 3786 | /******* Comment *******/ |
| 3787 | fp("<h3>Checkin Comment</h3>\n"); |
| @@ -3924,12 +3928,12 @@ | |
| 3924 | if(zComment && *zComment){ |
| 3925 | blob_append(&cimi.comment, zComment, -1); |
| 3926 | }else{ |
| 3927 | fail((&err,"Empty comment is not permitted.")); |
| 3928 | } |
| 3929 | cimi.pParent = manifest_get(vid, CFTYPE_MANIFEST, 0); |
| 3930 | assert(cimi.pParent && "We know vid is valid."); |
| 3931 | cimi.zFilename = mprintf("%s",zFilename); |
| 3932 | cimi.pMfOut = &manifest; |
| 3933 | checkin_mini(&cimi, &newVid, &err); |
| 3934 | if(newVid!=0){ |
| 3935 | zNewUuid = rid_to_uuid(newVid); |
| @@ -3963,13 +3967,15 @@ | |
| 3963 | "link.innerText=urlShort;\n" |
| 3964 | "link.setAttribute('href',urlFull);\n", |
| 3965 | zFilename, zNewUuid, zFilename, zNewUuid); |
| 3966 | } |
| 3967 | fossil_free(zNewUuid); |
| 3968 | } |
| 3969 | /* On error, the error message is in the err blob and will |
| 3970 | ** be emitted below. */ |
| 3971 | blob_reset(&manifest); |
| 3972 | }else if(2==submitMode/*preview*/){ |
| 3973 | /* TODO */ |
| 3974 | fail((&err,"Preview mode is still TODO.")); |
| 3975 | }else if(3==submitMode/*diff*/){ |
| @@ -3979,11 +3985,10 @@ | |
| 3979 | goto end_footer; |
| 3980 | } |
| 3981 | |
| 3982 | end_footer: |
| 3983 | zContent = 0; |
| 3984 | fossil_free(zRevResolved); |
| 3985 | fossil_free(zFileUuid); |
| 3986 | if(stmt.pStmt){ |
| 3987 | db_finalize(&stmt); |
| 3988 | } |
| 3989 | if(blob_size(&err)){ |
| 3990 |
| --- src/checkin.c | |
| +++ src/checkin.c | |
| @@ -2831,14 +2831,14 @@ | |
| 2831 | blob_reset(&p->fileHash); |
| 2832 | if(p->pParent){ |
| 2833 | manifest_destroy(p->pParent); |
| 2834 | } |
| 2835 | fossil_free(p->zFilename); |
| 2836 | fossil_free(p->zDate); |
| 2837 | fossil_free(p->zParentUuid); |
| 2838 | fossil_free(p->zMimetype); |
| 2839 | fossil_free(p->zUser); |
| 2840 | CheckinMiniInfo_init(p); |
| 2841 | } |
| 2842 | |
| 2843 | /* |
| 2844 | ** Internal helper which returns an F-card perms string suitable for |
| @@ -3039,11 +3039,11 @@ | |
| 3039 | if(blob_size(&pCI->comment)!=0){ |
| 3040 | blob_appendf(pOut, "C %F\n", blob_str(&pCI->comment)); |
| 3041 | }else{ |
| 3042 | blob_append(pOut, "C (no\\scomment)\n", 16); |
| 3043 | } |
| 3044 | blob_appendf(pOut, "D %s\n", pCI->zDate); |
| 3045 | if(create_manifest_mini_fcards(pOut,pCI,asDelta,pErr)==0){ |
| 3046 | return 0; |
| 3047 | } |
| 3048 | if(pCI->zMimetype!=0 && pCI->zMimetype[0]!=0){ |
| 3049 | blob_appendf(pOut, "N %F\n", pCI->zMimetype); |
| @@ -3133,11 +3133,11 @@ | |
| 3133 | } |
| 3134 | fossil_free(zProjCode); |
| 3135 | } |
| 3136 | db_begin_transaction(); |
| 3137 | |
| 3138 | if(pCI->pParent==0 && pCI->zParentUuid==0){ |
| 3139 | ci_err((pErr, "Cannot determine parent version.")); |
| 3140 | } |
| 3141 | else if(pCI->pParent==0){ |
| 3142 | pCI->pParent = manifest_get_by_name(pCI->zParentUuid, 0); |
| 3143 | if(pCI->pParent==0){ |
| @@ -3667,11 +3667,10 @@ | |
| 3667 | const char * zRev = P("r"); /* checkin version */ |
| 3668 | const char * zContent = P("content"); /* file content */ |
| 3669 | const char * zComment = P("comment"); /* checkin comment */ |
| 3670 | CheckinMiniInfo cimi; /* Checkin state */ |
| 3671 | int submitMode = 0; /* See mapping below */ |
| 3672 | int vid, newVid = 0; /* checkin rid */ |
| 3673 | char * zFileUuid = 0; /* File content UUID */ |
| 3674 | int frid = 0; /* File content rid */ |
| 3675 | Blob err = empty_blob; /* Error report */ |
| 3676 | const char * zFlagCheck = 0; /* Temp url flag holder */ |
| @@ -3722,11 +3721,11 @@ | |
| 3721 | if(0==vid){ |
| 3722 | fail((&err,"Could not resolve checkin version.")); |
| 3723 | } |
| 3724 | |
| 3725 | /* Find the repo-side file entry or fail... */ |
| 3726 | cimi.zParentUuid = rid_to_uuid(vid); |
| 3727 | db_prepare(&stmt, "SELECT uuid, perm FROM files_of_checkin " |
| 3728 | "WHERE filename=%Q %s AND checkinID=%d", |
| 3729 | zFilename, filename_collation(), vid); |
| 3730 | if(SQLITE_ROW==db_step(&stmt)){ |
| 3731 | const char * zPerm = db_column_text(&stmt, 1); |
| @@ -3737,11 +3736,12 @@ | |
| 3736 | zFileUuid = mprintf("%s",db_column_text(&stmt, 0)); |
| 3737 | } |
| 3738 | db_finalize(&stmt); |
| 3739 | if(!zFileUuid){ |
| 3740 | fail((&err,"Checkin [%S] does not contain file: " |
| 3741 | "<code>%h</code>", |
| 3742 | cimi.zParentUuid, zFilename)); |
| 3743 | } |
| 3744 | frid = fast_uuid_to_rid(zFileUuid); |
| 3745 | assert(frid); |
| 3746 | |
| 3747 | /* Read file content from submit request or repo... */ |
| @@ -3763,25 +3763,29 @@ | |
| 3763 | |
| 3764 | fp("<h1>Editing:</h1>"); |
| 3765 | fp("<p class='fileedit-hint'>"); |
| 3766 | fp("File: <code>%h</code><br>" |
| 3767 | "Version: <code id='r-label'>%s</code><br>", |
| 3768 | zFilename, cimi.zParentUuid); |
| 3769 | fp("Permalink: <code>" |
| 3770 | "<a id='permalink' href='%R/fileedit?file=%T&r=%!S'>" |
| 3771 | "/fileedit?file=%T&r=%!S</a></code><br>" |
| 3772 | "(Clicking the permalink will reload the page and discard " |
| 3773 | "all edits!)", |
| 3774 | zFilename, cimi.zParentUuid, |
| 3775 | zFilename, cimi.zParentUuid); |
| 3776 | fp("</p>"); |
| 3777 | fp("<p>This page is <em>far from complete</em> and may still have " |
| 3778 | "significant bugs. USE AT YOUR OWN RISK, preferably on a test " |
| 3779 | "repo.</p>\n"); |
| 3780 | |
| 3781 | fp("<form action='%R/fileedit' method='POST' " |
| 3782 | "class='fileedit-form'>\n"); |
| 3783 | |
| 3784 | /******* Hidden fields *******/ |
| 3785 | fp("<input type='hidden' name='r' value='%s'>", |
| 3786 | cimi.zParentUuid); |
| 3787 | fp("<input type='hidden' name='file' value='%T'>", |
| 3788 | zFilename); |
| 3789 | |
| 3790 | /******* Comment *******/ |
| 3791 | fp("<h3>Checkin Comment</h3>\n"); |
| @@ -3924,12 +3928,12 @@ | |
| 3928 | if(zComment && *zComment){ |
| 3929 | blob_append(&cimi.comment, zComment, -1); |
| 3930 | }else{ |
| 3931 | fail((&err,"Empty comment is not permitted.")); |
| 3932 | } |
| 3933 | /*cimi.pParent = manifest_get(vid, CFTYPE_MANIFEST, 0); |
| 3934 | assert(cimi.pParent && "We know vid is valid.");*/ |
| 3935 | cimi.zFilename = mprintf("%s",zFilename); |
| 3936 | cimi.pMfOut = &manifest; |
| 3937 | checkin_mini(&cimi, &newVid, &err); |
| 3938 | if(newVid!=0){ |
| 3939 | zNewUuid = rid_to_uuid(newVid); |
| @@ -3963,13 +3967,15 @@ | |
| 3967 | "link.innerText=urlShort;\n" |
| 3968 | "link.setAttribute('href',urlFull);\n", |
| 3969 | zFilename, zNewUuid, zFilename, zNewUuid); |
| 3970 | } |
| 3971 | fossil_free(zNewUuid); |
| 3972 | zNewUuid = 0; |
| 3973 | } |
| 3974 | /* On error, the error message is in the err blob and will |
| 3975 | ** be emitted below. */ |
| 3976 | cimi.pMfOut = 0; |
| 3977 | blob_reset(&manifest); |
| 3978 | }else if(2==submitMode/*preview*/){ |
| 3979 | /* TODO */ |
| 3980 | fail((&err,"Preview mode is still TODO.")); |
| 3981 | }else if(3==submitMode/*diff*/){ |
| @@ -3979,11 +3985,10 @@ | |
| 3985 | goto end_footer; |
| 3986 | } |
| 3987 | |
| 3988 | end_footer: |
| 3989 | zContent = 0; |
| 3990 | fossil_free(zFileUuid); |
| 3991 | if(stmt.pStmt){ |
| 3992 | db_finalize(&stmt); |
| 3993 | } |
| 3994 | if(blob_size(&err)){ |
| 3995 |