From b6fd1d28bc710a564aaca55cb6ec331b025a19ca Mon Sep 17 00:00:00 2001 From: Michiel Broek Date: Sat, 9 Jun 2007 11:48:48 +0000 Subject: [PATCH] The filelist now displays long filenames --- ChangeLog | 3 +++ lang/Language.xref | 2 +- lang/source.de | 2 +- lang/source.en | 2 +- lang/source.es | 2 +- lang/source.fr | 2 +- lang/source.gl | 2 +- lang/source.nl | 2 +- lang/source.zh | 2 +- mbsebbs/file.c | 24 +++++++++++++++--------- mbsebbs/filesub.c | 43 +++++++++++++++++++++++++++++-------------- mbsebbs/offline.c | 3 +++ 12 files changed, 58 insertions(+), 31 deletions(-) diff --git a/ChangeLog b/ChangeLog index 02f7778a..58d2e0d7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -14,6 +14,9 @@ v0.91.9 16-May-2007 Help message displays quoted description. The adopt command works even if the description isn't quoted. + mbsebbs: + The filelist now displays long filenames (finally). + mbpasswd: Added check for FreeBSD > 6.0 and use sysctl for security check. diff --git a/lang/Language.xref b/lang/Language.xref index 352942b3..51f77c32 100644 --- a/lang/Language.xref +++ b/lang/Language.xref @@ -353,7 +353,7 @@ 352 file.c |Updating download counter, please wait ... 353 file.c |Failed! 354 file.c |Bytes -355 file.c | # Area Active File Size Cost +355 file.c | # Area Active Size Cost File 356 file.c lineedit.c |Yes 357 file.c |No 358 file.c TE|(T)oggle active, (E)rase all, (ENTER) to continue: diff --git a/lang/source.de b/lang/source.de index 77661d52..f5e5dec3 100644 --- a/lang/source.de +++ b/lang/source.de @@ -353,7 +353,7 @@ JN|BBS-Details anzeigen ? [J/n]: |Download-Zaehler werden aktualisiert, bitte warten ... |Fehlgeschlagen! |Bytes -| # Area Aktiv Datei Gr. Kosten +| # Area Aktiv Gr. Kost Datei |Ja |Nein UA|Aufgelistete (U)mschalten, alle (A)bwaehlen, um fortzufahren: diff --git a/lang/source.en b/lang/source.en index fe59fb68..9fdbb463 100644 --- a/lang/source.en +++ b/lang/source.en @@ -353,7 +353,7 @@ YN|View this BBS? [Y/n]: |Updating download counters, please wait ... |Failed! |Bytes -| # Area Active File Size Cost +| # Area Active Size Cost File |Yes |No TE|(T)oggle active, (E)rase all, (ENTER) to continue: diff --git a/lang/source.es b/lang/source.es index aa92a46f..1f720643 100644 --- a/lang/source.es +++ b/lang/source.es @@ -353,7 +353,7 @@ SN| |Actualizando contadores de descarga... |­FALLO! |Bytes -| n§ Area Activa Fichero Tam. Coste +| n§ Area Activa Tam. Coste Fichero |Si |No AT|(A)ctivar/desactivar, desactivar (T)odos, (ENTER) para seguir: diff --git a/lang/source.fr b/lang/source.fr index 9658aab8..5bb70fde 100644 --- a/lang/source.fr +++ b/lang/source.fr @@ -353,7 +353,7 @@ YN|View this BBS? [Y/n]: |Updating download counters, please wait ... |Failed! |Bytes -| # Area Active File Size Cost +| # Area Active Size Cost File |Yes |No TE|(T)oggle active, (E)rase all, (ENTER) to continue: diff --git a/lang/source.gl b/lang/source.gl index 211cf51d..7f639425 100644 --- a/lang/source.gl +++ b/lang/source.gl @@ -353,7 +353,7 @@ SN| BBS? [S/n]: |Actualizando contadores de descarga... |­FALLO! |Bytes -| n§ Area Activa Fichero Tam. Coste +| n§ Area Activa Tam. Coste Fichero |Si |No AT|(A)ctivar/desactivar, desactivar (T)odos, (ENTER) para seguir: diff --git a/lang/source.nl b/lang/source.nl index 5c9eef13..8d8ac1f6 100644 --- a/lang/source.nl +++ b/lang/source.nl @@ -353,7 +353,7 @@ JN|Bekijk dit BBS? [J/n]: |Bijwerken download tellers, een ogenblik ... |Mislukt! |Bytes -| # Geb. Aktief Bestand Grootte Kosten +| # Geb. Aktief Grootte Prijs Bestand |Ja |Nee SV|(S)chakel aktief, (V)erwijder alles, (ENTER) voor doorgaan: diff --git a/lang/source.zh b/lang/source.zh index 25a4df3a..8498fe8b 100644 --- a/lang/source.zh +++ b/lang/source.zh @@ -353,7 +353,7 @@ YN|View this BBS? [Y/n]: |Updating download counters, please wait ... |Failed! |Bytes -| # Area Active File Size Cost +| # Area Active Size Cost File |Yes |No TE|(T)oggle active, (E)rase all, (ENTER) to continue: diff --git a/mbsebbs/file.c b/mbsebbs/file.c index 1e0861a7..6459f806 100644 --- a/mbsebbs/file.c +++ b/mbsebbs/file.c @@ -1675,16 +1675,19 @@ void EditTaglist() } temp = calloc(81, sizeof(char)); + if (utf8) + chartran_init((char *)"CP437", (char *)"UTF-8", 'B'); while (TRUE) { clear(); fseek(tf, 0, SEEK_SET); Count = 0; - /* # Area Active File Size Cost */ + /* # Area Active Size Cost File */ + /* 123 12345 123456 12345678 12345 */ pout(CFG.HiliteF, CFG.HiliteB, (char *) Language(355)); Enter(1); colour(LIGHTGREEN, BLACK); - fLine(48); + PUTSTR(chartran(fLine_str(79))); while ((fread(&Tag, sizeof(Tag), 1, tf) == 1)) { Count++; @@ -1698,33 +1701,34 @@ void EditTaglist() pout(Fg, BLACK, temp); Fg--; - snprintf(temp, 81, "%5d ", Tag.Area); + snprintf(temp, 81, "%5d ", Tag.Area); pout(Fg, BLACK, temp); Fg--; if (Tag.Active) /* Yes */ - snprintf(temp, 81, "%-6s ", (char *) Language(356)); + snprintf(temp, 81, "%-6s ", (char *) Language(356)); else /* No */ - snprintf(temp, 81, "%-6s ", (char *) Language(357)); + snprintf(temp, 81, "%-6s ", (char *) Language(357)); pout(Fg, BLACK, temp); Fg--; - snprintf(temp, 81, "%-12s", Tag.SFile); + snprintf(temp, 81, "%8d ", (int)(Tag.Size)); pout(Fg, BLACK, temp); Fg--; - snprintf(temp, 81, " %8d", (int)(Tag.Size)); + snprintf(temp, 81, "%5d ", Tag.Cost); pout(Fg, BLACK, temp); Fg--; - snprintf(temp, 81, " %5d", Tag.Cost); + snprintf(temp, 81, "%s", Tag.LFile); pout(Fg, BLACK, temp); + Enter(1); } colour(LIGHTGREEN, BLACK); - fLine(48); + PUTSTR(chartran(fLine_str(79))); /* (T)oggle active, (E)rase all, (ENTER) to continue: */ pout(WHITE, RED, (char *) Language(358)); @@ -1756,6 +1760,8 @@ void EditTaglist() } } + chartran_close(); + if (i == Keystroke(358, 1)) { fclose(tf); unlink("taglist"); diff --git a/mbsebbs/filesub.c b/mbsebbs/filesub.c index a1df8e54..cf1c99db 100644 --- a/mbsebbs/filesub.c +++ b/mbsebbs/filesub.c @@ -312,7 +312,7 @@ int iLC(int Lines) iLineCount += Lines; if ((iLineCount >= rows) && (iLineCount < 1000)) { - iLineCount = 0; + iLineCount = 1; while (TRUE) { /* More (Y/n/=) M=Mark */ @@ -359,23 +359,38 @@ int ShowOneFile() snprintf(temp, 81, " %02d ", Tagnr); pout(LIGHTGRAY, BLACK, temp); - snprintf(temp, 81, "%-12s", fdb.Name); - pout(CFG.FilenameF, CFG.FilenameB, temp); - - snprintf(temp, 81, "%10u ", (int)(fdb.Size)); - pout(CFG.FilesizeF, CFG.FilesizeB, temp); - - snprintf(temp, 81, "%-10s ", StrDateDMY(fdb.UploadDate)); - pout(CFG.FiledateF, CFG.FiledateB, temp); - snprintf(temp, 81, "[%4d] ", fdb.TimesDL); pout(LIGHTRED, BLACK, temp); - if ((strcmp(fdb.Uploader, "")) == 0) - strcpy(fdb.Uploader, "SysOp"); + snprintf(temp, 81, "%s", fdb.LName); + pout(CFG.FilenameF, CFG.FilenameB, temp); + Enter(1); + if (iLC(1) == 1) + return 1; - snprintf(temp, 81, "%s%s", (char *) Language(238), fdb.Uploader); - pout(CFG.HiliteF, CFG.HiliteB, temp); + snprintf(temp, 81, " %-10s ", StrDateDMY(fdb.UploadDate)); + pout(CFG.FiledateF, CFG.FiledateB, temp); + + snprintf(temp, 81, "%10u bytes ", (int)(fdb.Size)); + pout(CFG.FilesizeF, CFG.FilesizeB, temp); + +// snprintf(temp, 81, "%-12s", fdb.Name); +// pout(CFG.FilenameF, CFG.FilenameB, temp); + +// snprintf(temp, 81, "%10u ", (int)(fdb.Size)); +// pout(CFG.FilesizeF, CFG.FilesizeB, temp); + +// snprintf(temp, 81, "%-10s ", StrDateDMY(fdb.UploadDate)); +// pout(CFG.FiledateF, CFG.FiledateB, temp); + +// snprintf(temp, 81, "[%4d] ", fdb.TimesDL); +// pout(LIGHTRED, BLACK, temp); + +// if ((strcmp(fdb.Uploader, "")) == 0) +// strcpy(fdb.Uploader, "SysOp"); + +// snprintf(temp, 81, "%s%s", (char *) Language(238), fdb.Uploader); +// pout(CFG.HiliteF, CFG.HiliteB, temp); Enter(1); if (iLC(1) == 1) diff --git a/mbsebbs/offline.c b/mbsebbs/offline.c index b836e466..5d63cd66 100644 --- a/mbsebbs/offline.c +++ b/mbsebbs/offline.c @@ -700,7 +700,10 @@ void OLR_SyncTags() if (Changed) { colour(LIGHTGREEN, BLACK); + if (utf8) + chartran_init((char *)"CP437", (char *)"UTF-8", 'B'); fLine(79); + chartran_close(); Pause(); }