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,
|
/* 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 *
|
static char *
|
||||||
Io_filename(struct Io *io, FILE *f){
|
Io_filename(struct Io *io, FILE *f){
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if((i = Io_fileindex(io, f)) == -1)
|
return (f == NULL || (i = Io_fileindex(io, f)) == -1)
|
||||||
return NULL;
|
? NULL
|
||||||
else if(i < io->s - 1)
|
: (i < io->s - 1)
|
||||||
return io->names[i];
|
? io->names[i]
|
||||||
else
|
: io->ex->names[i - io->s];
|
||||||
return io->ex->names[i - io->s];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct Io *Io_fremove(struct Io *io, FILE *f);
|
static struct Io *Io_fremove(struct Io *io, FILE *f);
|
||||||
|
Loading…
Reference in New Issue
Block a user