Fossil SCM

Modify [b1dc17a0aa]: Use the APIs from hname.c to find hash algorithm names.

florian 2023-12-13 07:39 trunk
Commit a99a0fc08ba1f39eb0c21584d6f859f685b8e917ff354802c9e8d8d282391ffd
1 file changed +3 -1
--- src/unversioned.c
+++ src/unversioned.c
@@ -571,15 +571,17 @@
571571
while( db_step(&q)==SQLITE_ROW ){
572572
const char *zName = db_column_text(&q, 0);
573573
sqlite3_int64 mtime = db_column_int(&q, 1);
574574
const char *zHash = db_column_text(&q, 2);
575575
int isDeleted = zHash==0;
576
- char *zAlgo = isDeleted ? "deleted" : strlen(zHash) == 40 ? "SHA1" : "SHA3-256";
576
+ const char *zAlgo;
577577
int fullSize = db_column_int(&q, 3);
578578
char *zAge = human_readable_age((iNow - mtime)/86400.0);
579579
const char *zLogin = db_column_text(&q, 4);
580580
int rcvid = db_column_int(&q,5);
581
+ if( isDeleted ) zAlgo = "deleted";
582
+ else zAlgo = hname_alg(strlen(zHash));
581583
if( zLogin==0 ) zLogin = "";
582584
if( (n++)==0 ){
583585
style_table_sorter();
584586
@ <div class="uvlist">
585587
@ <table cellpadding="2" cellspacing="0" border="1" class='sortable' \
586588
--- src/unversioned.c
+++ src/unversioned.c
@@ -571,15 +571,17 @@
571 while( db_step(&q)==SQLITE_ROW ){
572 const char *zName = db_column_text(&q, 0);
573 sqlite3_int64 mtime = db_column_int(&q, 1);
574 const char *zHash = db_column_text(&q, 2);
575 int isDeleted = zHash==0;
576 char *zAlgo = isDeleted ? "deleted" : strlen(zHash) == 40 ? "SHA1" : "SHA3-256";
577 int fullSize = db_column_int(&q, 3);
578 char *zAge = human_readable_age((iNow - mtime)/86400.0);
579 const char *zLogin = db_column_text(&q, 4);
580 int rcvid = db_column_int(&q,5);
 
 
581 if( zLogin==0 ) zLogin = "";
582 if( (n++)==0 ){
583 style_table_sorter();
584 @ <div class="uvlist">
585 @ <table cellpadding="2" cellspacing="0" border="1" class='sortable' \
586
--- src/unversioned.c
+++ src/unversioned.c
@@ -571,15 +571,17 @@
571 while( db_step(&q)==SQLITE_ROW ){
572 const char *zName = db_column_text(&q, 0);
573 sqlite3_int64 mtime = db_column_int(&q, 1);
574 const char *zHash = db_column_text(&q, 2);
575 int isDeleted = zHash==0;
576 const char *zAlgo;
577 int fullSize = db_column_int(&q, 3);
578 char *zAge = human_readable_age((iNow - mtime)/86400.0);
579 const char *zLogin = db_column_text(&q, 4);
580 int rcvid = db_column_int(&q,5);
581 if( isDeleted ) zAlgo = "deleted";
582 else zAlgo = hname_alg(strlen(zHash));
583 if( zLogin==0 ) zLogin = "";
584 if( (n++)==0 ){
585 style_table_sorter();
586 @ <div class="uvlist">
587 @ <table cellpadding="2" cellspacing="0" border="1" class='sortable' \
588

Keyboard Shortcuts

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