mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-07-03 04:22:47 -05:00
Changed my mind about r7164. Instead of checking for zero flags
inside one single uxsel front end, better to do it centrally and
avoid passing zero flags on to the front end in the first place. I'm
sure other similarly structured front ends could get confused by it
too.
[originally from svn r7171]
[r7164 == 65f9735b95
]
This commit is contained in:
22
unix/uxsel.c
22
unix/uxsel.c
@ -62,22 +62,18 @@ void uxsel_init(void)
|
||||
|
||||
void uxsel_set(int fd, int rwx, uxsel_callback_fn callback)
|
||||
{
|
||||
struct fd *newfd = snew(struct fd);
|
||||
struct fd *oldfd;
|
||||
struct fd *newfd;
|
||||
|
||||
newfd->fd = fd;
|
||||
newfd->rwx = rwx;
|
||||
newfd->callback = callback;
|
||||
uxsel_del(fd);
|
||||
|
||||
oldfd = find234(fds, newfd, NULL);
|
||||
if (oldfd) {
|
||||
uxsel_input_remove(oldfd->id);
|
||||
del234(fds, oldfd);
|
||||
sfree(oldfd);
|
||||
if (rwx) {
|
||||
newfd = snew(struct fd);
|
||||
newfd->fd = fd;
|
||||
newfd->rwx = rwx;
|
||||
newfd->callback = callback;
|
||||
newfd->id = uxsel_input_add(fd, rwx);
|
||||
add234(fds, newfd);
|
||||
}
|
||||
|
||||
add234(fds, newfd);
|
||||
newfd->id = uxsel_input_add(fd, rwx);
|
||||
}
|
||||
|
||||
void uxsel_del(int fd)
|
||||
|
Reference in New Issue
Block a user