修正輸出檔名判斷邏輯

Signed-off-by: Huei-Horng Yo <hiroshiyui@gmail.com>