diff options
author | Ron Yorston <rmy@pobox.com> | 2014-03-23 21:27:25 +0000 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2014-03-23 21:27:25 +0000 |
commit | a89d412ced2d9498260dae34fa8aa9e28fa56ca8 (patch) | |
tree | 657773b0339eab2ffbba00ba8e1300d4a881d919 /libbb | |
parent | 439b40bd12f55cfb2f28d3f52831041d21b4393e (diff) | |
download | busybox-w32-a89d412ced2d9498260dae34fa8aa9e28fa56ca8.tar.gz busybox-w32-a89d412ced2d9498260dae34fa8aa9e28fa56ca8.tar.bz2 busybox-w32-a89d412ced2d9498260dae34fa8aa9e28fa56ca8.zip |
Provide fake getpwent_r to reduce changes from upstream
Diffstat (limited to 'libbb')
-rw-r--r-- | libbb/lineedit.c | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/libbb/lineedit.c b/libbb/lineedit.c index 4bb1ab783..4cb9eba4b 100644 --- a/libbb/lineedit.c +++ b/libbb/lineedit.c | |||
@@ -672,18 +672,15 @@ static char *username_path_completion(char *ud) | |||
672 | */ | 672 | */ |
673 | static NOINLINE unsigned complete_username(const char *ud) | 673 | static NOINLINE unsigned complete_username(const char *ud) |
674 | { | 674 | { |
675 | #if !ENABLE_PLATFORM_MINGW32 | ||
676 | /* Using _r function to avoid pulling in static buffers */ | 675 | /* Using _r function to avoid pulling in static buffers */ |
677 | char line_buff[256]; | 676 | char line_buff[256]; |
678 | struct passwd pwd; | 677 | struct passwd pwd; |
679 | struct passwd *result; | 678 | struct passwd *result; |
680 | #endif | ||
681 | unsigned userlen; | 679 | unsigned userlen; |
682 | 680 | ||
683 | ud++; /* skip ~ */ | 681 | ud++; /* skip ~ */ |
684 | userlen = strlen(ud); | 682 | userlen = strlen(ud); |
685 | 683 | ||
686 | #if !ENABLE_PLATFORM_MINGW32 | ||
687 | setpwent(); | 684 | setpwent(); |
688 | while (!getpwent_r(&pwd, line_buff, sizeof(line_buff), &result)) { | 685 | while (!getpwent_r(&pwd, line_buff, sizeof(line_buff), &result)) { |
689 | /* Null usernames should result in all users as possible completions. */ | 686 | /* Null usernames should result in all users as possible completions. */ |
@@ -692,7 +689,6 @@ static NOINLINE unsigned complete_username(const char *ud) | |||
692 | } | 689 | } |
693 | } | 690 | } |
694 | endpwent(); | 691 | endpwent(); |
695 | #endif | ||
696 | 692 | ||
697 | return 1 + userlen; | 693 | return 1 + userlen; |
698 | } | 694 | } |