RCS file: /cvsroot/mplayer/main/m_option.c,v
retrieving revision 1.48
diff -u -r1.48 m_option.c
|
|
|
|
| 560 | 560 | n = 0; |
| 561 | 561 | |
| 562 | 562 | while(1) { |
| | 563 | if (ptr[0] == '"') { |
| | 564 | last_ptr = &ptr[1]; |
| | 565 | ptr = strchr(last_ptr, '"'); |
| | 566 | if (!ptr || (ptr[1] && ptr[1] != LIST_SEPARATOR)) { |
| | 567 | res[n] = NULL; |
| | 568 | free_str_list(res); |
| | 569 | return M_OPT_PARSER_ERR; |
| | 570 | } |
| | 571 | len = ptr - last_ptr; |
| | 572 | ptr++; |
| | 573 | } else { |
| 563 | 574 | last_ptr = ptr; |
| 564 | 575 | ptr = strchr(ptr,LIST_SEPARATOR); |
| 565 | 576 | if(!ptr) { |
| … |
… |
|
| 568 | 579 | break; |
| 569 | 580 | } |
| 570 | 581 | len = ptr - last_ptr; |
| | 582 | } |
| 571 | 583 | res[n] = (char*)malloc(len + 1); |
| 572 | 584 | if(len) strncpy(res[n],last_ptr,len); |
| 573 | 585 | res[n][len] = '\0'; |