-
src/sbbs3/prntfile.cpp
From
rswindell@1:103/705 to
CVS commit on Mon Feb 26 18:29:19 2018
src/sbbs3 prntfile.cpp 1.23 1.24
Update of /cvsroot/sbbs/src/sbbs3
In directory cvs:/home/rswindell/sbbs/src/sbbs3
Modified Files:
prntfile.cpp
Log Message:
printfile() and printtail() now use fexistcase() to get the proper case
of the passed filei, fixing a long-standing issue with a couple of menu commands (e.g. "MAININFO") in the WWIV (and possibly other) command shells. Thank Nelgin. Are we keeping count yet?
--- SBBSecho 3.03-Win32
* Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
-
From
deuce@1:103/705 to
CVS commit on Tue Feb 27 00:03:26 2018
src/sbbs3 prntfile.cpp 1.25 1.26
Update of /cvsroot/sbbs/src/sbbs3
In directory cvs:/tmp/cvs-serv25527
Modified Files:
prntfile.cpp
Log Message:
Revert commit during update breakage.
--- SBBSecho 3.03-Win32
* Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
-
From
rswindell@1:103/705 to
CVS commit on Sun Sep 30 18:56:31 2018
src/sbbs3 prntfile.cpp 1.26 1.27
Update of /cvsroot/sbbs/src/sbbs3
In directory cvs:/tmp/cvs-serv27555
Modified Files:
prntfile.cpp
Log Message:
When displaying menu files (using printfile()), enable CPM/EOF mode
(stops parsing/displaying upon Ctrl-Z) - this solves the SAUCE record
issue for sysops (e.g. using PabloDraw).
--- SBBSecho 3.06-Linux
* Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
-
From
rswindell@1:103/705 to
CVS commit on Fri Feb 1 16:44:08 2019
src/sbbs3 prntfile.cpp 1.31 1.32
Update of /cvsroot/sbbs/src/sbbs3
In directory cvs:/tmp/cvs-serv25862
Modified Files:
prntfile.cpp
Log Message:
Restore the functionality in menu() lost in rev 1.29 where if you pass a
full path (sans file suffix/extension), it would use that path for the menu file to be displayed.
--- SBBSecho 3.06-Linux
* Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
-
From
rswindell@1:103/705 to
CVS commit on Thu Aug 8 15:20:56 2019
src/sbbs3 prntfile.cpp 1.35 1.36
Update of /cvsroot/sbbs/src/sbbs3
In directory cvs:/tmp/cvs-serv27724
Modified Files:
prntfile.cpp
Log Message:
Return to the sbbs v2 behavior of printfile() behavior (sort-of): When P_OPENCLOSE mode flag is *not* specified, do not malloc()/read() the entire file and then display. Instead, print one line at a time (so long as that
line is <= 1MB in length), calling putmsg() for each line.
This should allow the viewing of massive text files in SBBS again without alloc/swap issues.
I left the calls to utf8_normalize_str() in here, but I'm not so sure about them now. putmsg() will convert UTF-8 to CP437 through print_utf8_as_cp437(), and that only lacks a couple of conversions that utf8_normalize_str() does (e.g. ellipsis to "..."), so that might be a good candidate to remove in
the future.
--- SBBSecho 3.08-Linux
* Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
-
From
rswindell@1:103/705 to
CVS commit on Thu Aug 8 20:39:18 2019
src/sbbs3 prntfile.cpp 1.36 1.37
Update of /cvsroot/sbbs/src/sbbs3
In directory cvs:/tmp/cvs-serv13401
Modified Files:
prntfile.cpp
Log Message:
Fix off-by-two issue with fgets() calls in printfile() line-at-a-time mode (new). Reported by Alterego (ALTERANT)
--- SBBSecho 3.08-Linux
* Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
-
From
rswindell@1:103/705 to
CVS commit on Wed Aug 14 19:15:20 2019
src/sbbs3 prntfile.cpp 1.37 1.38
Update of /cvsroot/sbbs/src/sbbs3
In directory cvs:/tmp/cvs-serv20524
Modified Files:
prntfile.cpp
Log Message:
Fix line-at-a-time mode printfile() operation with regards to attributes maintained between lines, reported by Immortal@IDOMAIN:
Use P_SAVEATR to retain the new attributes after each call to putmsg() in printfile() line-at-a-time mode. We are no setting the initial attribute to LIGHTGRAY or restoring the original attribute at the end (like a call to putmsg() withou the P_SAVEATR would) - so we may need to add that later
for line-at-a-time mode, as well.
--- SBBSecho 3.08-Linux
* Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
-
From
rswindell@1:103/705 to
CVS commit on Thu Aug 15 23:47:09 2019
src/sbbs3 prntfile.cpp 1.38 1.39
Update of /cvsroot/sbbs/src/sbbs3
In directory cvs:/tmp/cvs-serv2768
Modified Files:
prntfile.cpp
Log Message:
Save/restore the current attribute in printfile() line-at-a-time mode unless the P_SAVEATR mode flag was specified (behave like the P_OPENCLOSE mode).
--- SBBSecho 3.08-Linux
* Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
-
From
rswindell@1:103/705 to
CVS commit on Fri Sep 20 01:36:48 2019
src/sbbs3 prntfile.cpp 1.39 1.40
Update of /cvsroot/sbbs/src/sbbs3
In directory cvs:/tmp/cvs-serv391
Modified Files:
prntfile.cpp
Log Message:
Work-around observed infinite loop trying to print a 0-byte file where
feof() was returning 0 and fgets() never returned NULL. Weird.
--- SBBSecho 3.10-Linux
* Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
-
From
rswindell@1:103/705 to
CVS commit on Thu Apr 23 22:33:39 2020
src/sbbs3 prntfile.cpp 1.40 1.41
Update of /cvsroot/sbbs/src/sbbs3
In directory cvs:/tmp/cvs-serv12380
Modified Files:
prntfile.cpp
Log Message:
Fix bug reported by Nelgin in printfile(), when called with-OUT the P_OPENCLOSE mode flag, an EOF @-code would not stop the output since it calls putmsg()
for *each* line of the file and was not checking the return value of putmsg() for an abnormal/early-termination indicator.
--- SBBSecho 3.10-Linux
* Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
-
From
rswindell@1:103/705 to
CVS commit on Fri May 1 23:09:38 2020
src/sbbs3 prntfile.cpp 1.42 1.43
Update of /cvsroot/sbbs/src/sbbs3
In directory cvs:/tmp/cvs-serv20164
Modified Files:
prntfile.cpp
Log Message:
Keep Deuce from killing Vert by viewing 16GB log files:
Don't use P_OPENCLOSE printfile() mode for any files > 2MB in size.
--- SBBSecho 3.11-Linux
* Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
-
From
rswindell@1:103/705 to
CVS commit on Sat May 2 00:55:21 2020
src/sbbs3 prntfile.cpp 1.43 1.44
Update of /cvsroot/sbbs/src/sbbs3
In directory cvs:/tmp/cvs-serv10676
Modified Files:
prntfile.cpp
Log Message:
Make printtail() not load entire files into memory, but instead read the last part of the file, assuming lines are not >8K (on average).
--- SBBSecho 3.11-Linux
* Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
-
From
Rob Swindell@1:103/705 to
Git commit to sbbs/master on Sun Nov 22 00:14:40 2020
https://gitlab.synchro.net/sbbs/sbbs/-/commit/a5b344c97eebf2879f563371
Modified Files:
src/sbbs3/prntfile.cpp
Log Message:
Convert menu paths (e.g. /sbbs/text/menu/../filename) to full pathsIf text/menu
is a symlink (on *nix), then the path above would actuallypoint to a filename in the parent of the symlink target, which is notwhat we want (we want the filename in the text dir). Fixed by usingFULLPATH.
--- SBBSecho 3.11-Linux
* Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
-
From
Rob Swindell@1:103/705 to
Git commit to main/sbbs/master on Sat Dec 5 19:26:39 2020
https://gitlab.synchro.net/main/sbbs/-/commit/bba2a9d5f6426be4cec140f8
Modified Files:
src/sbbs3/prntfile.cpp
Log Message:
Don't print a CRLF in printfile() (called by menu) if no file existsprintfile()
assumes you want the file displayed starting in column 0, so will send a CRLF to insure that it does (unless the P_NOCRLF mode flag is specified). But this CRLF printing was happening before the file was opened and when the P_NOERROR mode flag is specified, this should be a silent failure with no print output. So move the CRLF printing to *after* the file is opened.This expose an issue in
the latest xtrn_sec.js where it makes several calls to bbs.menu() with the P_NOERROR mode flag set, expecting nothing to happen if/when the optional display files (e.g. xtrn*_tail.*) don't exist.Reported by JC via IRC.
--- SBBSecho 3.11-Linux
* Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
-
From
Digital Man@1:103/705 to
Git commit to main/sbbs/master on Sat Dec 5 19:32:24 2020
Re: src/sbbs3/prntfile.cpp
By: Rob Swindell to Git commit to main/sbbs/master on Sat Dec 05 2020 07:26 pm
https://gitlab.synchro.net/main/sbbs/-/commit/bba2a9d5f6426be4cec140f8 Modified Files:
src/sbbs3/prntfile.cpp
Log Message:
Don't print a CRLF in printfile() (called by menu) if no file exists
printfile() assumes you want the file displayed starting in column 0, so will send a CRLF to insure that it does (unless the P_NOCRLF mode flag is specified). But this CRLF printing was happening before the file was opened and when the P_NOERROR mode flag is specified, this should be a silent failure with no print output. So move the CRLF printing to *after* the file is opened.
This expose an issue in the latest xtrn_sec.js where it makes several calls to bbs.menu() with the P_NOERROR mode flag set, expecting nothing to happen if/when the optional display files (e.g. xtrn*_tail.*) don't exist.
Reported by JC via IRC.
Correction: reported by Dan_C.
--
digital man
Synchronet/BBS Terminology Definition #49:
MODEM = Modulator/Demodulator
Norco, CA WX: 60.5°F, 22.0% humidity, 0 mph S wind, 0.00 inches rain/24hrs
--- SBBSecho 3.11-Linux
* Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
-
From
Rob Swindell@1:103/705 to
Git commit to main/sbbs/master on Thu Mar 24 21:49:53 2022
https://gitlab.synchro.net/main/sbbs/-/commit/479bd24c574ad0dbe6461d09
Modified Files:
src/sbbs3/prntfile.cpp
Log Message:
De-dupe random menu filenames by truncating at first dot, rather than last.Fix for one of the problems described in issue #380.bbs.menu("random*"); would display column-width-specific files (e.g.random.132col.msg) even when they weren't appropriate for the currentuser terminal width.This is fixed by truncating the filenames matching the requested pattern attheir first-dot rather than the last.The downside is, you can't have a set of random.#.* files,
where # is theunique part of the filename and * is the file-type extension. Just usethe naming pattern "random-#.*" instead (or something similar) instead. --- SBBSecho 3.15-Linux
* Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
-
From
Rob Swindell@1:103/705 to
Git commit to main/sbbs/master on Thu Mar 24 23:14:29 2022
https://gitlab.synchro.net/main/sbbs/-/commit/a8db694b2acee8cc66221bea
Modified Files:
src/sbbs3/prntfile.cpp
Log Message:
Use text/menu/*.###col.* display files for even-wider terminalse.g. display basename.132col.msg even if the terminal is 133+ columns wide.Fixes issue #380. --- SBBSecho 3.15-Linux
* Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
-
From
Rob Swindell@1:103/705 to
Git commit to main/sbbs/master on Thu Mar 24 23:58:06 2022
https://gitlab.synchro.net/main/sbbs/-/commit/e3ba24274983408008b1bf32
Modified Files:
src/sbbs3/prntfile.cpp
Log Message:
Revert to *.XXcol.* being an exact column width, add *.cXX.* supportThat previous commit made all *.40col.msg files display for 80 column users. Not my intention.So revert to the previous behavior of *.XXcol.* display files. I didn't want to go renaming a bunch of menu files as a result of the previous commit and I didn't want a bunch of sysops with *.XXcol.* files to be suddenly surprised at their new BBS behavior.And introduce a new file naming convention,
*.cXX.* (where XX is a MINIMUM column width). This is the same naming convention used by Mystic, which also treats it is as a minimum terminal width,
not a required exact width.
--- SBBSecho 3.15-Linux
* Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
-
From
Rob Swindell@1:103/705 to
Git commit to main/sbbs/master on Fri Mar 25 00:37:53 2022
https://gitlab.synchro.net/main/sbbs/-/commit/9ac7335f36e51bfd13f953e4
Modified Files:
src/sbbs3/prntfile.cpp
Log Message:
Detect/display menu files, even if only a .ans version existsI'm so tired of this 30 year old frequently asked question.If a sysop really wants their Synchronet BBS to only work correctly for ANSI users, I suppose that should be their prerogative.I always felt that by not detecting/displaying menu files when the minimum set of files was not present, I was helping sysops to identify
an issue with their system (which would not work correctly for non-ANSI users).
*And* I always felt that having a single menu/display file that correctly supported both ANSI and non-ANSI users was a nice convenience (who really wants
to maintain multiple versions of their menu files?). But I'm so tired of answering this question, I just give up.Hopefully this doesn't break anything for anyone. <shrug>
--- SBBSecho 3.15-Linux
* Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
-
From
MRO@1:103/705 to
Rob Swindell on Fri Mar 25 05:31:47 2022
Re: src/sbbs3/prntfile.cpp
By: Rob Swindell to Git commit to main/sbbs/master on Fri Mar 25 2022 12:37 am
I'm so tired of this 30 year old frequently asked question.
If a sysop really wants their Synchronet BBS to only work correctly for ANSI users, I suppose that should be their prerogative.
I always felt that by not detecting/displaying menu files when the minimum set of files was not present, I was helping sysops to identify an issue with their system (which would not work correctly for non-ANSI users). *And* I always felt that having a single menu/display file that correctly supported both ANSI and non-ANSI users was a nice convenience (who really wants to maintain multiple versions of their menu files?). But I'm so tired of answering this question, I just give up.
thanks for giving up.
---
■ Synchronet ■ ::: BBSES.info - free BBS services :::
* Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
-
From
Digital Man@1:103/705 to
MRO on Fri Mar 25 12:35:07 2022
Re: src/sbbs3/prntfile.cpp
By: MRO to Rob Swindell on Fri Mar 25 2022 05:31 am
thanks for giving up.
I feel for the dozens of PETSCII terminal users that might be impacted.
Oh well. :-)
--
digital man (rob)
This Is Spinal Tap quote #20:
Well, I'm sure I'd feel much worse if I weren't under such heavy sedation. Norco, CA WX: 81.9°F, 28.0% humidity, 5 mph ESE wind, 0.00 inches rain/24hrs --- SBBSecho 3.15-Linux
* Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
-
From
MRO@1:103/705 to
Digital Man on Fri Mar 25 15:26:51 2022
Re: src/sbbs3/prntfile.cpp
By: Digital Man to MRO on Fri Mar 25 2022 12:35 pm
Re: src/sbbs3/prntfile.cpp
By: MRO to Rob Swindell on Fri Mar 25 2022 05:31 am
thanks for giving up.
I feel for the dozens of PETSCII terminal users that might be impacted.
Oh well. :-)
maybe have it do a special entry in the log file.
---
■ Synchronet ■ ::: BBSES.info - free BBS services :::
* Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
-
From
Digital Man@1:103/705 to
MRO on Fri Mar 25 14:18:00 2022
Re: src/sbbs3/prntfile.cpp
By: MRO to Digital Man on Fri Mar 25 2022 03:26 pm
Re: src/sbbs3/prntfile.cpp
By: Digital Man to MRO on Fri Mar 25 2022 12:35 pm
Re: src/sbbs3/prntfile.cpp
By: MRO to Rob Swindell on Fri Mar 25 2022 05:31 am
thanks for giving up.
I feel for the dozens of PETSCII terminal users that might be impacted. Oh well. :-)
maybe have it do a special entry in the log file.
I'm thinking just have chksetup.js detect/report when a menu set is missing a .asc or .msg version.
--
digital man (rob)
Synchronet/BBS Terminology Definition #24:
DOVE = Domain/Vertrauen
Norco, CA WX: 85.1°F, 32.0% humidity, 7 mph SSE wind, 0.00 inches rain/24hrs --- SBBSecho 3.15-Linux
* Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
-
From
Rob Swindell@1:103/705 to
Git commit to main/sbbs/master on Sat Mar 26 20:03:49 2022
-
From
Rob Swindell (on Windows 11)@1:103/705 to
Git commit to main/sbbs/master on Mon Aug 26 17:10:47 2024
https://gitlab.synchro.net/main/sbbs/-/commit/46c603ce3c9eba660f425cc4
Modified Files:
src/sbbs3/prntfile.cpp
Log Message:
Fix NULL pointer deref in random_menu()
When no files with extensions are found, though they matched the glob() pattern, a NULL pointer deref would result (segfault).
This could happen if the only files matching the pattern had no extenions or were directories (not files).
Fix for issue #779
--- SBBSecho 3.20-Linux
* Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
-
From
Rob Swindell (on Windows 11)@1:103/705 to
Git commit to main/sbbs/master on Thu Oct 10 22:23:27 2024
https://gitlab.synchro.net/main/sbbs/-/commit/b656e19ff168e27583a33c26
Modified Files:
src/sbbs3/prntfile.cpp
Log Message:
Report error when menu() can't find a display file and P_NOERROR not used
This issue was introduced in commit d02fc1a2 (3 years ago), where menu() would silenty fail (just return false) if no display file matching the supported menu/display file types/extensions could be found.
Previous to commit d02fc1a2, we would log a NOTICE-level message and display
a "File not found" message to the user (what sbbs_t::printfile() does), but since d02fc1a2, we no longer even call printfile() when the file doesn't
exist, so no error was logged or message displayed to the user.
Of course, when using the P_NOERROR mode flag, silent failure is expected and that's still what happens in that case.
--- SBBSecho 3.20-Linux
* Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
-
From
Rob Swindell (on Debian Linux)@1:103/705 to
Git commit to main/sbbs/master on Sun Oct 13 02:26:14 2024
https://gitlab.synchro.net/main/sbbs/-/commit/639781e2ad929914bf27f469
Modified Files:
src/sbbs3/prntfile.cpp
Log Message:
Don't use global menu_dir for calls to menu() with path starting with '.'
For scripts that set the global menu_dir (e.g. via JS bbs.menu_dir), let's
not require that all the files moved from text to text/menu (for example).
Problem reported by Amessyroom when using his custom shell and bullseye.js.
--- SBBSecho 3.20-Linux
* Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
-
From
Rob Swindell (on Debian Linux)@1:103/705 to
Git commit to main/sbbs/master on Thu Dec 5 17:00:15 2024
https://gitlab.synchro.net/main/sbbs/-/commit/16ffc14082970177cd14efa8
Modified Files:
src/sbbs3/prntfile.cpp
Log Message:
Add "Printing file" and "Printing tail" debug-level log messages
In printfile() and printtail() which are used by menu() and many other functions.
These should be helpful to sysops that just want to know what file is being displayed under what conditions (e.g. for trouble-shooting or customization reasons).
--- SBBSecho 3.23-Linux
* Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
-
From
Rob Swindell (on Windows 11)@1:103/705 to
Git commit to main/sbbs/master on Mon Feb 3 18:56:14 2025
https://gitlab.synchro.net/main/sbbs/-/commit/ca77086526440a723dfd30e7
Modified Files:
src/sbbs3/prntfile.cpp
Log Message:
Fix random menu/display file selection when some files can't be displayed
When one or more files that match the menu file pattern can't be displayed (e.g. the user's terminal is not wide enough or there's any other menu file open/read error), pick another random menu file and try displaying that one, until either a menu file has been displayed successfully or all files
(matching the pattern) have been attempted.
For example, you have text/menu/random1.c80.msg and random2.msg, if the first file (random1.c80.msg) is selected at random but the user's terminal isn't
at least 80 columns wide, another file will be picked at random. Since only random2.msg remains in the list (matching the pattern "random*"), that's the only file that will always be displayed.
--- SBBSecho 3.23-Linux
* Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
-
From
Rob Swindell (on Windows 11)@1:103/705 to
Git commit to main/sbbs/master on Tue Apr 8 16:52:07 2025
https://gitlab.synchro.net/main/sbbs/-/commit/b6cebf82986e178a0594a09f
Modified Files:
src/sbbs3/prntfile.cpp
Log Message:
Disable Celerity "pipe code" parsing when displaying ".rip" files
RIP sequences conflict with Celerity pipe codes, so don't convert them to
color codes (even when enabled in SCFG->Systems->Extra Attribute Codes...).
We *used* to disable all pipe code parsing when sending to a RIP-enabled terminal but since we don't do that any longer, this is a better/cleaner fix.
Renegade "pipe codes" (|xx where xx are decimal digits) don't "seem" to conflict with any RIP sequences (so leave that parsing enabled for .rip files) but Deuce can help me to be sure about that (please).
--- SBBSecho 3.24-Linux
* Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
-
From
Rob Swindell (on Debian Linux)@1:103/705 to
Git commit to main/sbbs/master on Sat May 3 16:51:17 2025
https://gitlab.synchro.net/main/sbbs/-/commit/3a3e4dbd316f60e5ffd784bb
Modified Files:
src/sbbs3/prntfile.cpp
Log Message:
Resolve relative menu/../* to absolute path before checking for file existence
On *nix, fexist("../mods/text/menu/../filename") would fail unless the mods/text/menu sub-directory existed. It works on Windows fine however.
This resolves issue #918, reported by Keyop - thank you!
--- SBBSecho 3.24-Linux
* Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)
-
From
Rob Swindell (on Debian Linux)@1:103/705 to
Git commit to main/sbbs/master on Sat May 3 22:47:05 2025