mirror of
https://github.com/ZDoom/qzdoom.git
synced 2025-01-30 12:31:07 +00:00
Update DUMB to revision b17c5254eeac1bff7e4b613c151e0232c2cba646
- Remove trailing whitespace from all song, instrument, and sample names SVN r4101 (trunk)
This commit is contained in:
parent
1e422f8921
commit
fb98650e4d
1 changed files with 11 additions and 0 deletions
|
@ -117,6 +117,14 @@ XM_INSTRUMENT_EXTRA;
|
|||
|
||||
|
||||
|
||||
/* Trims off trailing white space, usually added by the tracker on file creation
|
||||
*/
|
||||
static void trim_whitespace(char *ptr, size_t size)
|
||||
{
|
||||
char *p = ptr + size - 1;
|
||||
while (p >= ptr && *p <= 0x20) *p-- = '\0';
|
||||
}
|
||||
|
||||
/* Frees the original block if it can't resize it or if size is 0, and acts
|
||||
* as malloc if ptr is NULL.
|
||||
*/
|
||||
|
@ -506,6 +514,7 @@ static int it_xm_read_instrument(IT_INSTRUMENT *instrument, XM_INSTRUMENT_EXTRA
|
|||
|
||||
dumbfile_getnc(instrument->name, 22, f);
|
||||
instrument->name[22] = 0;
|
||||
trim_whitespace(instrument->name, 22);
|
||||
instrument->filename[0] = 0;
|
||||
dumbfile_skip(f, 1); /* Instrument type. Should be 0, but seems random. */
|
||||
extra->n_samples = dumbfile_igetw(f);
|
||||
|
@ -665,6 +674,7 @@ static int it_xm_read_sample_header(IT_SAMPLE *sample, DUMBFILE *f)
|
|||
|
||||
dumbfile_getnc(sample->name, 22, f);
|
||||
sample->name[22] = 0;
|
||||
trim_whitespace(sample->name, 22);
|
||||
|
||||
sample->filename[0] = 0;
|
||||
|
||||
|
@ -919,6 +929,7 @@ static DUMB_IT_SIGDATA *it_xm_load_sigdata(DUMBFILE *f, int * version)
|
|||
return NULL;
|
||||
}
|
||||
sigdata->name[20] = 0;
|
||||
trim_whitespace(sigdata->name, 20);
|
||||
|
||||
if (dumbfile_getc(f) != 0x1A) {
|
||||
TRACE("XM error: 0x1A not found\n");
|
||||
|
|
Loading…
Reference in a new issue