client/server: client sends its CWD to server

This commit is contained in:
Daniel Eklöf 2019-12-21 19:56:37 +01:00
parent 0bb15d3d16
commit 277735db65
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
2 changed files with 20 additions and 1 deletions

View file

@ -175,7 +175,14 @@ fdm_client(struct fdm *fdm, int fd, int events, void *data)
const uint8_t *end = &client->buffer.data[client->buffer.idx];
CHECK_BUF(sizeof(uint16_t));
uint16_t term_env_len = *(uint16_t *)p; p += sizeof(term_env_len);
uint16_t cwd_len = *(uint16_t *)p; p += sizeof(cwd_len);
CHECK_BUF(cwd_len);
const char *cwd = (const char *)p; p += cwd_len;
LOG_DBG("CWD = %.*s", cwd_len, cwd);
CHECK_BUF(sizeof(uint16_t));
uint16_t term_env_len = *(uint16_t *)p; p += term_env_len;
CHECK_BUF(term_env_len);
const char *term_env = (const char *)p; p += strlen(term_env) + 1;