[TD-6274]<fix>: taos shell --file bug. (#7570)

This commit is contained in:
Shuduo Sang 2021-08-25 12:23:21 +08:00 committed by GitHub
parent ceeb22d667
commit 697ff6aee2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -108,7 +108,7 @@ static error_t parse_opt(int key, char *arg, struct argp_state *state) {
arguments->is_raw_time = true;
break;
case 'f':
if (wordexp(arg, &full_path, 0) != 0) {
if ((0 == strlen(arg)) || (wordexp(arg, &full_path, 0) != 0)) {
fprintf(stderr, "Invalid path %s\n", arg);
return -1;
}