summaryrefslogtreecommitdiff
path: root/src/deh_io.c
AgeCommit message (Collapse)Author
2015-04-21deh: fix parsing of last lines in files without newline at EOFFabian Greffrath
Chocolate Doom fails to properly parse the last line in DEHACKED files that are missing a newline character at the end of the file (which might have been a common sickness to DOS editors). This is, because DEH_GetChar() returns -1 at EOF and DEH_ReadLine() in turn immediately returns NULL if the result of (DEH_GetChar() < 0), regardless of the content of the readbuffer. It only returns a pointer to the content of the readbuffer if DEH_GetChar() returns '\n' which is, however, impossible if there is no such character before the file ends. Now DEH_ReadLine() only returns NULL if the readbuffer is empty at the end of the file and returns a valid pointer else. Fixes #531
2014-10-24Replace strdup() with M_StringDuplicate().Simon Howard
strdup() can theoretically fail and return NULL. This could lead to a crash or undesirable behavior. Add M_StringDuplicate() which does the same thing but exits with an error if a string cannot be allocated. This fixes #456. Thanks to Quasar for the suggestion.
2014-09-15deh_main.c: fix "warning: implicit declaration of function ‘I_Error’"Fabian Greffrath
2014-09-13dehacked: Load Freedoom DEHACKED lump on startup.Simon Howard
If using one of the Freedoom IWADs, detect it by checking for the FREEDOOM lump, and then load its DEHACKED lump to apply the cosmetic string changes that it includes. In case we're using an old version of one of the Freedoom IWADs, don't bomb out with an error while parsing the DEHACKED lump.
2014-09-11simplify and generalize deh_allow_extended_strings usageFabian Greffrath
2014-09-11improvements to the [STRINGS] section parserFabian Greffrath
- restructure DEH_ReadLine() to avoid use of "goto" - bex_string_t type name ends in "_t" - declare constant table as "static const" - add magic comment *allow-extended-strings* and corresponding variable deh_allow_extended_strings - fix logical error when no [STRINGS] section is registered to which corrent_section could be compared
2014-09-08add parser for [STRINGS] sections in BEX filesFabian Greffrath
2014-07-15free() some allocated bytesFabian Greffrath
Thanks valgrind!
2014-05-05Clean up file headers.Simon Howard
This change rewrites and simplifies the copyright headers at the top of all source files: * Remove "Emacs style mode select" line; this line was included in the headers for the originally released source files and appears to be to set the file type for old versions of Emacs. I'm not sure entirely why it was required but I don't think it is any more. * Remove "You should have received a copy of..." text from copyright header. This refers to the old 59 Temple Place address where the FSF headquarters used to be located and is no longer correct. Rather than change to the new address, just remove the paragraph as it is superfluous anyway. This fixes #311. * Remove ---- separator lines so that the file headers are barer and more simplified.
2014-03-30dehacked: Eliminate some more uses of strncpy().Simon Howard
Use M_StringCopy() instead of strncpy() in the Dehacked code.
2011-05-08Shut up compiler warnings.Simon Howard
Subversion-branch: /trunk/chocolate-doom Subversion-revision: 2333
2010-11-30Oops.Simon Howard
Subversion-branch: /trunk/chocolate-doom Subversion-revision: 2180
2010-11-30Add support for HACX v1.2 IWAD file.Simon Howard
Subversion-branch: /trunk/chocolate-doom Subversion-revision: 2176
2008-09-07Strip out NUL characters from dehacked files; this makes the dehackedSimon Howard
patch with portal.wad load properly. Subversion-branch: /trunk/chocolate-doom Subversion-revision: 1208
2006-10-18Strip out CVS logs, RCS Id tags.Simon Howard
Subversion-branch: /trunk/chocolate-doom Subversion-revision: 704
2006-09-02Don't allow \0 in dehacked strings read with DEH_ReadLine.Simon Howard
Subversion-branch: /trunk/chocolate-doom Subversion-revision: 594
2005-10-08Proper dehacked error/warning framework. Catch a load more errors.Simon Howard
Subversion-branch: /trunk/chocolate-doom Subversion-revision: 175
2005-10-02The beginnings of dehacked supportSimon Howard
Subversion-branch: /trunk/chocolate-doom Subversion-revision: 153