Fossil SCM

Both push and pull demonstrated, linux-to-linux.

drh 2021-06-22 12:41 patch-cmd
Commit e60389b0d6d5ece39060c5127d2b695a43927faf24ec4fc194beaba69a98c819
1 file changed +7 -3
+7 -3
--- src/patch.c
+++ src/patch.c
@@ -224,15 +224,18 @@
224224
}
225225
if( zIn==0 ){
226226
Blob buf;
227227
int rc;
228228
int sz;
229
- const unsigned char *pData;
229
+ unsigned char *pData;
230230
blob_init(&buf, 0, 0);
231231
sz = blob_read_from_channel(&buf, in, -1);
232
- pData = (const unsigned char*)blob_buffer(&buf);
232
+ pData = (unsigned char*)blob_buffer(&buf);
233233
db_multi_exec("ATTACH ':memory:' AS patch");
234
+ if( g.fSqlTrace ){
235
+ fossil_trace("-- deserialize(\"patch\", pData, %lld);\n", sz);
236
+ }
234237
rc = sqlite3_deserialize(g.db, "patch", pData, sz, sz, 0);
235238
if( rc ){
236239
fossil_fatal("cannot open patch database: %s", sqlite3_errmsg(g.db));
237240
}
238241
}else if( !file_isfile(zIn, ExtFILE) ){
@@ -520,11 +523,12 @@
520523
const char *zDir = 0;
521524
const char *zBaseName;
522525
char *zToFree = 0;
523526
char *zPatchFile = 0;
524527
if( zDir64 ){
525
- zToFree = decode64(zDir64, 0);
528
+ int n = 0;
529
+ zToFree = decode64(zDir64, &n);
526530
zDir = zToFree;
527531
}
528532
verify_all_options();
529533
if( g.argc!=4 && g.argc!=5 ){
530534
usage(mprintf("%s [DIRECTORY] FILENAME", zCmdName));
531535
--- src/patch.c
+++ src/patch.c
@@ -224,15 +224,18 @@
224 }
225 if( zIn==0 ){
226 Blob buf;
227 int rc;
228 int sz;
229 const unsigned char *pData;
230 blob_init(&buf, 0, 0);
231 sz = blob_read_from_channel(&buf, in, -1);
232 pData = (const unsigned char*)blob_buffer(&buf);
233 db_multi_exec("ATTACH ':memory:' AS patch");
 
 
 
234 rc = sqlite3_deserialize(g.db, "patch", pData, sz, sz, 0);
235 if( rc ){
236 fossil_fatal("cannot open patch database: %s", sqlite3_errmsg(g.db));
237 }
238 }else if( !file_isfile(zIn, ExtFILE) ){
@@ -520,11 +523,12 @@
520 const char *zDir = 0;
521 const char *zBaseName;
522 char *zToFree = 0;
523 char *zPatchFile = 0;
524 if( zDir64 ){
525 zToFree = decode64(zDir64, 0);
 
526 zDir = zToFree;
527 }
528 verify_all_options();
529 if( g.argc!=4 && g.argc!=5 ){
530 usage(mprintf("%s [DIRECTORY] FILENAME", zCmdName));
531
--- src/patch.c
+++ src/patch.c
@@ -224,15 +224,18 @@
224 }
225 if( zIn==0 ){
226 Blob buf;
227 int rc;
228 int sz;
229 unsigned char *pData;
230 blob_init(&buf, 0, 0);
231 sz = blob_read_from_channel(&buf, in, -1);
232 pData = (unsigned char*)blob_buffer(&buf);
233 db_multi_exec("ATTACH ':memory:' AS patch");
234 if( g.fSqlTrace ){
235 fossil_trace("-- deserialize(\"patch\", pData, %lld);\n", sz);
236 }
237 rc = sqlite3_deserialize(g.db, "patch", pData, sz, sz, 0);
238 if( rc ){
239 fossil_fatal("cannot open patch database: %s", sqlite3_errmsg(g.db));
240 }
241 }else if( !file_isfile(zIn, ExtFILE) ){
@@ -520,11 +523,12 @@
523 const char *zDir = 0;
524 const char *zBaseName;
525 char *zToFree = 0;
526 char *zPatchFile = 0;
527 if( zDir64 ){
528 int n = 0;
529 zToFree = decode64(zDir64, &n);
530 zDir = zToFree;
531 }
532 verify_all_options();
533 if( g.argc!=4 && g.argc!=5 ){
534 usage(mprintf("%s [DIRECTORY] FILENAME", zCmdName));
535

Keyboard Shortcuts

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