KEGS' DynaPro feature drops trailing periods in filenames.

42 views
Skip to first unread message

Brian Patrie

unread,
Jun 9, 2022, 12:55:42 AMJun 9
to
I use trailing periods in ProDOS filenames from time to time (usually to
indicate that something has been modified from it's original form); but,
on a DynaPro mounted directory, odd things happen, and they ultimately
get dropped.

My current main usage of DynaPro is for using a host-native text editor
to edit text files; so it's only a minor inconvenience. But it would be
nice to see it eventually fixed.

It would also be nice if at least some of the ProDOS permission bits
were preserved somehow. But again, i can live with it as is for now; so
no rush.

:)

I'm using KEGS v1.16, under Linux Mint, btw.

Kent Dickey

unread,
Jun 13, 2022, 10:27:08 AMJun 13
to
In article <t7rugd$h9l$1...@gioia.aioe.org>,
This was an unfortunate bug in KEGS caused by the routine trying to legalize
names from your host Linux system to be valid ProDOS names.

When a character which is not valid for ProDOS was found in the native
name (say, en emoji, a space, anything other than A-Za-z0-9 or .), KEGS
would convert that character to a '.' in the ProDOS name.

So a name like "file (9)" would become "file..9.". So then KEGS tried to
eliminate '.'s at the end of the filename since they weren't useful, to
create "file..9" in this example.

But: if the native name already had a dot at the end, this was a legal
ProDOS name, but KEGS was still tossing it. So "TRY1." would be changed
to "TRY1". This is the bug you found.

I just made the step for converting unknown characters to '.' remember which
ones were real '.'s and which ones are converted characters, so "TRY1."
stays "TRY1." but "file (9)" becomes "file..9" still.

I'm not sure when the next KEGS release will be. If you want an immediate
fix and can recompile, edit dynapro.c around lines 1369-1372 to remove these
lines:

while((outpos >= 0) && (g_dynapro_path_buf[outpos-1] == '.')) {
outpos--;
g_dynapro_path_buf[outpos] = 0;
}

This the code removing the trailing '.' from the end of the filename, and
it's what's causing your problem. Without this code, native name "file (9)"
will become "file..9.", but that's not really a problem.

Kent

Brian Patrie

unread,
Jun 15, 2022, 4:55:53 AMJun 15
to
Kent Dickey wrote:
> If you want an immediate fix and can recompile, edit dynapro.c
> around lines 1369-1372 to remove these lines:
>
> while((outpos >= 0) && (g_dynapro_path_buf[outpos-1] == '.')) {
> outpos--;
> g_dynapro_path_buf[outpos] = 0;
> }
>
> This the code removing the trailing '.' from the end of the
> filename, and it's what's causing your problem. Without this
> code, native name "file (9)" will become "file..9.", but that's
> not really a problem.

Excellent! Thanks! :)
And, of course, i named the modified version "xkegs-1.16." ;)
Reply all
Reply to author
Forward
0 new messages