| 43 | /************************************************************************/ |
| 44 | |
| 45 | paralist *pj_clone_paralist( const paralist *list) |
| 46 | { |
| 47 | paralist *list_copy = nullptr, *next_copy = nullptr; |
| 48 | |
| 49 | for( ; list != nullptr; list = list->next ) |
| 50 | { |
| 51 | paralist *newitem = (paralist *) |
| 52 | malloc(sizeof(paralist) + strlen(list->param)); |
| 53 | assert(newitem); |
| 54 | |
| 55 | newitem->used = 0; |
| 56 | newitem->next = nullptr; |
| 57 | strcpy( newitem->param, list->param ); |
| 58 | |
| 59 | if( next_copy ) |
| 60 | next_copy->next = newitem; |
| 61 | else |
| 62 | list_copy = newitem; |
| 63 | |
| 64 | next_copy = newitem; |
| 65 | } |
| 66 | |
| 67 | return list_copy; |
| 68 | } |
| 69 | |
| 70 | /************************************************************************/ |
| 71 | /* pj_clear_initcache() */ |
no test coverage detected