ternary
This commit is contained in:
parent
28c3448eda
commit
d46a189914
13
mm/mm.c
13
mm/mm.c
@ -143,17 +143,16 @@ Io_fileindex(struct Io *io, FILE *f){
|
||||
}
|
||||
|
||||
/* Returns the corresponding file name in the io struct to the FILE pointer f,
|
||||
* or NULL if f isn't in io->files or io->ex->files. */
|
||||
* or NULL if f is NULL or isn't in io->files or io->ex->files. */
|
||||
static char *
|
||||
Io_filename(struct Io *io, FILE *f){
|
||||
int i;
|
||||
|
||||
if((i = Io_fileindex(io, f)) == -1)
|
||||
return NULL;
|
||||
else if(i < io->s - 1)
|
||||
return io->names[i];
|
||||
else
|
||||
return io->ex->names[i - io->s];
|
||||
return (f == NULL || (i = Io_fileindex(io, f)) == -1)
|
||||
? NULL
|
||||
: (i < io->s - 1)
|
||||
? io->names[i]
|
||||
: io->ex->names[i - io->s];
|
||||
}
|
||||
|
||||
static struct Io *Io_fremove(struct Io *io, FILE *f);
|
||||
|
Loading…
Reference in New Issue
Block a user