[Asterisk-code-review] file.c/ ast file read dirs: Truncate path after calling stat (asterisk[master])

Kevin Harwell asteriskteam at digium.com
Tue Nov 15 12:37:12 CST 2016


Kevin Harwell has posted comments on this change. ( https://gerrit.asterisk.org/4447 )

Change subject: file.c/__ast_file_read_dirs:  Truncate path after calling stat
......................................................................


Patch Set 2: Code-Review-1

(2 comments)

https://gerrit.asterisk.org/#/c/4447/2/main/file.c
File main/file.c:

Line 1156: 			ast_str_truncate(*path, size);
If this is a directory that needs to be recursed into won't this truncate the directory name off? Which doesn't get appended later.

It appears that there are instances where the subsequent truncate doesn't get called on the next iteration. I wonder if moving the ast_str_truncate to right before the if/else would fix it?


Line 1161: 			ast_log(LOG_VERBOSE, "!###### d_name=%s, path=%s, WE USED IT YO used_stat=%d\n", entry->d_name, ast_str_buffer(*path), used_stat);
Don't know how this made it by the first review, but the log verbose messages should be removed. Looks like there may be more than one hanging around too.


-- 
To view, visit https://gerrit.asterisk.org/4447
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I54e4228bd8355fad65200c6df3ec4c9c8a98dfba
Gerrit-PatchSet: 2
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Owner: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-HasComments: Yes



More information about the asterisk-code-review mailing list