diff --git a/src/core/p-clipboard.c b/src/core/p-clipboard.c index 7d3fdce74f..db5cf92f36 100644 --- a/src/core/p-clipboard.c +++ b/src/core/p-clipboard.c @@ -50,6 +50,24 @@ req = Use_Port_State(port, RDI_CLIPBOARD, sizeof(REBREQ)); switch (action) { + case A_UPDATE: + // Update the port object after a READ or WRITE operation. + // This is normally called by the WAKE-UP function. + arg = OFV(port, STD_PORT_DATA); + if (req->command == RDC_READ) { + len = req->actual; + if (GET_FLAG(req->flags, RRF_WIDE)) { + len /= sizeof(REBUNI); //correct length + // Copy the string (convert to latin-8 if it fits): + Set_Binary(arg, Copy_Wide_Str(req->data, len)); + } else { + Set_Binary(arg, Copy_OS_Str(req->data, len)); + } + } + else if (req->command == RDC_WRITE) { + SET_NONE(arg); // Write is done. + } + return R_NONE; case A_READ: // This device is opened on the READ: