Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add new feature command history #171

Merged
merged 23 commits into from
May 29, 2018
Merged

add new feature command history #171

merged 23 commits into from
May 29, 2018

Conversation

LucasMLK
Copy link
Contributor

1.add last command for #82
2.modify some code style
3.add define for windows

@xrdavies
Copy link
Contributor

xrdavies commented May 26, 2018

No need to create new PR. Just submit your code, the old one will be updated automatically. Please take care of your PR next time. Thank you.

And now without the review history we have to review it again.... 😿

Copy link
Contributor

@xrdavies xrdavies left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please find comments.


#if !defined(_WIN32) && !defined(_WIN64)
rl_readline_name = "xdag";
rl_attempted_completion_function = xdag_com_completion;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New memory malloced in xdag_com_completion, how is it handled? Freed by readline lib or manually?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

xdag_com_completion malloc memory will free in readline lib auto:

in readline lib version 6.3 , complete.c:

1160 if (rl_attempted_completion_function)
1161 {
1162 matches = (*rl_attempted_completion_function) (text, start, end);
1163 if (RL_SIG_RECEIVED())
1164 {
1165 _rl_free_match_list (matches);
1166 matches = 0;
1167 RL_CHECK_SIGNALS ();
1168 }
1169
1170 if (matches || rl_attempted_completion_over)
1171 {
1172 rl_attempted_completion_over = 0;
1173 return (matches);
1174 }
1175 }

_rl_free_match_list will free memory:

1897 void
1898 _rl_free_match_list (matches)
1899 char **matches;
1900 {
1901 register int i;
1902
1903 if (matches == 0)
1904 return;
1905
1906 for (i = 0; matches[i]; i++)
1907 xfree (matches[i]);
1908 xfree (matches);
1909 }

if (!ptr) continue;
if (!strcmp(ptr, "exit")) break;
if (!strcmp(ptr, "xfer")) {
uint32_t pwd[4];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still has spaces and tabs issue. Could you just use tabs instead of spaces?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

@LucasMLK
Copy link
Contributor Author

LucasMLK commented May 27, 2018

i will take care of my PR next time

@xrdavies
Copy link
Contributor

Thank you for your great efforts!

@xrdavies xrdavies merged commit 1a88c7c into XDagger:develop May 29, 2018
@xrdavies xrdavies mentioned this pull request May 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants