Skip to content

Commit 4c12fe9

Browse files
committed
Close previous file if cat is in progress
1 parent c0d9d7c commit 4c12fe9

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

command_interface.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,10 @@ void command_interface_process_byte(char incoming)
185185

186186
NRF_LOG_INFO("filename %s", filename);
187187
NRF_LOG_FLUSH();
188+
if (cat_in_progress)
189+
{
190+
lfs_file_close(m_lfs, &file_command_interface);
191+
}
188192
if(lfs_file_opencfg(m_lfs, &file_command_interface, filename, LFS_O_RDONLY, &lfs_file_config) >= 0)
189193
{
190194
sprintf((char *)command_response_buffer, "cat,%s", filename);

0 commit comments

Comments
 (0)