(main, USERNAME): Change Windows user name from win-empcl2.8 to nobody
to get rid of the version number. Keeping it up-to-date by hand is
too much work, but leaving it at 2.8 would be confusing.
(move_ground): explore() used endsect without initialized in certain
cases, e.g. `expl X,Y N X,Y'. Other callers might have had similar
problems. Fix: always assign to *END. Thanks to Marc Olzheim for
help with debugging and fixing this.
(iom, fdmax, newoutput): Serve no purpose since previous rev., remove
along with code to maintain them. This removes the last uses of
io_mask.c io_mask.h; remove them.
Creating make include files with make doesn't work with many makes out
there. Back out for 4.2.13. You have to create the make include
files by hand if they don't exist. That's the case for freshly
checked out trees.
(RESOLVE_IPADDRESS): gethostbyaddr() uses a lot of stack space on some
versions of GNU libc, which can lead to nasty heap smashes (observed
with 2.2.93). Don't define RESOLVE_IPADDRESS for now, until we
readjust thread stack sizes.
(OSXCFLAGS): Don't switch gcc to cruft mode.
(OSXLFLAGS): Don't sweep undefined references under the carpet; link
with the right libraries instead.
(LINUXCFLAGS, LINUXPTHCFLAGS): Compile with symbols.
Garbage collection to side-step sparse file descriptor problem.
(io_select, io_flush, io_iopfromfd): Unused, remove.
(io_open): Allow more than one open for the same file descriptor.
The check is the last remaining use of io_list[], and it's
unimportant.
(io_list, niop, io_init): io_list[] no longer serves any purpose,
remove. Sparse allocation of file descriptors (deplorable misfeature
of Winsock, at least some versions) is no longer a problem.
(getfdtablesize): Unused, remove. Was broken for Windows anyway.
(io_open, io_iopfromfd): Properly check argument FD to protect
io_list[] indexing.
(niop, io_init): Store length of io_list[] in new niop.
(player_accept): Checking the socket file descriptor here is now
redundant. Remove.
(landmine): Add a missing call of putland(). Closes #682570. Don't
complain about running out of things when the job actually completed
fine. From Marc Olzheim.
(map): Reject flags `t' and `r' unless it's a bmap command. Both used
to change the map command into the corresponding bmap command, which
was undocumented and didn't make sense. From Marc Olzheim.
(wrgamesdef): Generate EMPDIR instead of EMPPATH(). Change callers of
EMPPATH() to use EMPDIR. This avoids triggering MSVC bugs, and drops
support for traditional, pre-ISO cpp. Closes #753935.
(gamedir, lostfil, playerbin, updatebin): Unused, remove.
(file_lock, file_unlock, ef_lock, ef_unlock, commlock, communlock):
File locking doesn't make sense, must be a leftover from the distant
past. Remove. Callers changed.
(take_move_in_mob): Automatic fortification on excess mobility may
fortify units while they are `at the prompt'. That's okay. But
action that consumes mobility must zap the fortification again.
Use strict & warnings. Fix several minor bugs uncovered by it.
Semantics of assigning to $[ changed in Perl 5, and its use is `highly
discouraged'. Programs obviously assumed $[ affects all arrays, but
it doesn't in Perl 5. If these programs ever worked, then certainly
not with Perl 5. Remove the assignments and shift indexes
accordingly.
(guerrilla): Give wandering che inexact, somewhat randomized
information on military. Closes #750533. Why? Wandering che pick a
sector with minimal military from the adjacent sectors that can get
che. Ties are broken in favour of the first sector examined. Since
sectors are examined in the order given by by diroff[], che prefer
directions with low index in diroff[]. This tends to channel che
towards the northeast. But the change makes ties very unlikely.
(lnd_sweep, lnd_mar_one_sector): Automatic fortification on excess
mobility may fortify units while they are `at the march prompt'.
That's okay. But action that consumes mobility must zap the
fortification again.
(do_mob_land): Use excess mobility to fortify. Note that units
requiring fuel to gain mobility never get excess mobility. Adapted
patch from from Marc Olzheim. Closes #725457.
(player_new): Proper error checking. Oops, now it may return NULL.
Proper error checking in callers required.
(update_wait, market_update): If player_new() returns null pointer,
skip update.
(player_accept): If player_new() returns null pointer, close
connection.
(io_select, io_init, io_open, io_close, io_output, io_flush, io_write,
io_puts, iom_create, iom_getmask, iom_set, iom_clear, iom_zero):
Portability bug: io_select() passed bit_fdmask to select(). This
breaks the fd_set abstraction, and works only with the traditional
Unix implementation of fd_set. Use fd_set and its operations instead.
Remove unused source files. Note: the offending code is currently
unsued. But it's a time bomb, and fixing it also replaces a bunch of
code by standard library services.
(main): Portability bug: code passed bit_fdmask to select(). This
breaks the fd_set abstraction, and works only with the traditional
Unix implementation of fd_set. Use fd_set and its operations instead.
Remove unused source files.
(player_coms, lstats, lsta): Rename command `lstats' to `lstat' to
match info as well as related commands `sstat' and `pstat'. Rename
lstats() to lsta() to uphold the convention that functions
implementing commands are named like the command or its four character
prefix. Closes #804587.
(player_coms, best): `bestdistpath' and `bestpath' violate the rule
that commands must be unique within the first four letters. best()
implements both. It calls BestDistPath() for the former, and
BestLandPath() for the latter. However, BestDistPath() is just a
wrapper around BestLandPath(); it does exactly the same. Drop
`bestdistpath'.
(bzero, bcopy): Obsolete BSDisms; remove. Remove some calls without
effect. Replace calls by struct assignment where possible. Replace
clear buffer, copy string to buffer by strncpy(). Use assignment to
clear when that's clearer. Replace overlapping copy through bounce
buffer by memmove(). Replace rest by standard memset() and memcpy().
Also use sizeof() instead of literal array sizes for robustness, and
instead of symbolic array sizes for clarity.
(login): Fix reading of country name and, if we lack getpass(),
password. Used to strip \r from country name (superflous), and not to
strip \n from password (required).