Skip to content

Commit e98426e

Browse files
committed
sys/shell: rename shell_readline()
1 parent 584e14b commit e98426e

File tree

4 files changed

+5
-7
lines changed

4 files changed

+5
-7
lines changed

sys/include/shell.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ int shell_parse_file(const shell_command_t *commands,
293293
* @return EOF, if the end of the input stream was reached.
294294
* @return -ENOBUFS if the buffer size was exceeded.
295295
*/
296-
int readline(char *buf, size_t size);
296+
int shell_readline(char *buf, size_t size);
297297

298298
#ifndef __cplusplus
299299
/**

sys/shell/cmds/udptty.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@
3232
#define EOT 0x4
3333
#endif
3434

35-
extern int readline(char *buf, size_t size);
36-
3735
static void _sock_cb(sock_udp_t *sock, sock_async_flags_t flags, void *arg)
3836
{
3937
(void)arg;
@@ -90,7 +88,7 @@ static int _udptty_cmd(int argc, char **argv)
9088

9189
do {
9290
char buf[64];
93-
res = readline(buf, sizeof(buf));
91+
res = shell_readline(buf, sizeof(buf));
9492

9593
if (res > 0) {
9694
buf[res] = '\n';

sys/shell/shell.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ static inline void new_line(void)
439439
}
440440
}
441441

442-
int readline(char *buf, size_t size)
442+
int shell_readline(char *buf, size_t size)
443443
{
444444
int curr_pos = 0;
445445
bool length_exceeded = false;
@@ -513,7 +513,7 @@ void shell_run_once(const shell_command_t *shell_commands,
513513
print_prompt();
514514

515515
while (1) {
516-
int res = readline(line_buf, len);
516+
int res = shell_readline(line_buf, len);
517517

518518
if (IS_USED(MODULE_SHELL_LOCK)) {
519519
if (shell_lock_is_locked()) {

sys/shell_lock/shell_lock.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ static bool _login(char *line_buf, size_t buf_size)
105105

106106
while (1) {
107107
memset(line_buf, 0, buf_size);
108-
while (readline(line_buf, buf_size) > 0) {
108+
while (shell_readline(line_buf, buf_size) > 0) {
109109
return _safe_strcmp(line_buf, CONFIG_SHELL_LOCK_PASSWORD);
110110
}
111111
}

0 commit comments

Comments
 (0)