Euphoria 2.4 Featured Bug?

new topic     » topic index » view thread      » older message » newer message

Hello all!

I committed one of those absent-minded screwups today, and in doing so, I
think I may have found either a
really cool feature or a really minor bug in the ex.exe interpreter
(possibly in exw.exe as well, although I haven't tested that theory).

I had just come over to Windows from Linux, to test out my code on Windows
XP.  I wanted to call the program
from outside its home folder, so I entered the following at the XP command
prompt:

ex eudoxy/eudoxy

Note that I entered the path *as though* I were in Linux.  The fact I did
this didn't dawn on me, because ex located and ran eudoxy.ex despite my
trans-OS issues.  However, I became puzzled when the following code produced
the message "Error:  Could not determine eudoxy.exe's home directory":

-- start code

cmd = command_line()
sWhereAmI = reverse(cmd[2])
loc = find('\\', sWhereAmI)
if loc != 0 then
  sWhereAmI = reverse(sWhereAmI[loc .. length(sWhereAmI)])
else
  puts(1, "Error: Could not determine eudoxy.exe's home directory.\n")
  -- This shouldn't happen.
end if

-- end code

Note that this will be released in bound form, hence the "exe."

A look in an ex.err file revealed this:

    cmd = {
            {67'C',58':',92'\',69'E',85'U',80'P',72'H',79'O',82'R',73'I',
65'A',92'\',66'B',73'I',78'N',92'\',69'E',88'X',46'.',69'E',88'X',69'E'},
            {101'e',117'u',100'd',111'o',120'x',121'y',47'/',101'e',117'u',
100'd',111'o',120'x',121'y'}

Notice two things:  First, the *Nixish separator, /, was preserved in
cmd[2].  Secondly, although the interpreter automagically added the .ex to
the end of "eudoxy," it did not add it to the end of the file name as given
in cmd[2].  From this, it appears that where the second element of
command_line() is concerned, I:

1.  Cannot assume that the path separator will be "\" in WinDos.
2.  Cannot assume that the name of a source code file will end with the
correct Euphoria extension.

Is this old news that I missed in my absence, or something new?

Now, I looked through the docs, and I did not see any mention of this
behavior.  If this is supposed to be the normal behavior of the interpreter,
it may be a good idea to state that in the documentation.  It would take a
real idiot to use "/" in DOS ... but I've proven to myself that such idiots
exist.


Travis Beaty
Osage, Iowa.

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu