Merge branch 'maint'
This commit is contained in:
commit
790c83cda9
@ -650,6 +650,7 @@ git so take care if using Cogito etc.
|
|||||||
If the 'GIT_DIR' environment variable is set then it
|
If the 'GIT_DIR' environment variable is set then it
|
||||||
specifies a path to use instead of the default `.git`
|
specifies a path to use instead of the default `.git`
|
||||||
for the base of the repository.
|
for the base of the repository.
|
||||||
|
The '--git-dir' command-line option also sets this value.
|
||||||
|
|
||||||
'GIT_WORK_TREE'::
|
'GIT_WORK_TREE'::
|
||||||
Set the path to the working tree. The value will not be
|
Set the path to the working tree. The value will not be
|
||||||
|
@ -301,14 +301,14 @@ static void pll_free(struct pll *l)
|
|||||||
*/
|
*/
|
||||||
static struct pll * get_permutations(struct pack_list *list, int n)
|
static struct pll * get_permutations(struct pack_list *list, int n)
|
||||||
{
|
{
|
||||||
struct pll *subset, *ret = NULL, *new_pll = NULL, *pll;
|
struct pll *subset, *ret = NULL, *new_pll = NULL;
|
||||||
|
|
||||||
if (list == NULL || pack_list_size(list) < n || n == 0)
|
if (list == NULL || pack_list_size(list) < n || n == 0)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if (n == 1) {
|
if (n == 1) {
|
||||||
while (list) {
|
while (list) {
|
||||||
new_pll = xmalloc(sizeof(pll));
|
new_pll = xmalloc(sizeof(*new_pll));
|
||||||
new_pll->pl = NULL;
|
new_pll->pl = NULL;
|
||||||
pack_list_insert(&new_pll->pl, list);
|
pack_list_insert(&new_pll->pl, list);
|
||||||
new_pll->next = ret;
|
new_pll->next = ret;
|
||||||
@ -321,7 +321,7 @@ static struct pll * get_permutations(struct pack_list *list, int n)
|
|||||||
while (list->next) {
|
while (list->next) {
|
||||||
subset = get_permutations(list->next, n - 1);
|
subset = get_permutations(list->next, n - 1);
|
||||||
while (subset) {
|
while (subset) {
|
||||||
new_pll = xmalloc(sizeof(pll));
|
new_pll = xmalloc(sizeof(*new_pll));
|
||||||
new_pll->pl = subset->pl;
|
new_pll->pl = subset->pl;
|
||||||
pack_list_insert(&new_pll->pl, list);
|
pack_list_insert(&new_pll->pl, list);
|
||||||
new_pll->next = ret;
|
new_pll->next = ret;
|
||||||
|
Loading…
Reference in New Issue
Block a user