mirror of
https://github.com/s3fs-fuse/s3fs-fuse.git
synced 2025-01-24 14:28:24 +00:00
Changed codes for CR code in passwd file(googlecode issue#417).
This commit is contained in:
parent
f1f7e76be5
commit
61020370d5
18
src/s3fs.cpp
18
src/s3fs.cpp
@ -2976,10 +2976,18 @@ static int check_for_aws_format(void)
|
|||||||
ifstream PF(passwd_file.c_str());
|
ifstream PF(passwd_file.c_str());
|
||||||
if(PF.good()){
|
if(PF.good()){
|
||||||
while (getline(PF, line)){
|
while (getline(PF, line)){
|
||||||
if(line[0]=='#')
|
if(line[0]=='#'){
|
||||||
continue;
|
continue;
|
||||||
if(line.size() == 0)
|
}
|
||||||
|
if(line.size() == 0){
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
|
if('\r' == line[line.size() - 1]){
|
||||||
|
line = line.substr(0, line.size() - 1);
|
||||||
|
if(line.size() == 0){
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
first_pos = line.find_first_of(" \t");
|
first_pos = line.find_first_of(" \t");
|
||||||
if(first_pos != string::npos){
|
if(first_pos != string::npos){
|
||||||
@ -3129,6 +3137,12 @@ static int read_passwd_file(void)
|
|||||||
if(line.size() == 0){
|
if(line.size() == 0){
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if('\r' == line[line.size() - 1]){
|
||||||
|
line = line.substr(0, line.size() - 1);
|
||||||
|
if(line.size() == 0){
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
first_pos = line.find_first_of(" \t");
|
first_pos = line.find_first_of(" \t");
|
||||||
if(first_pos != string::npos){
|
if(first_pos != string::npos){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user