Skip to content

Comments

[Bugfix] hexo help list command causes OutOfMemory#1209

Merged
tommy351 merged 5 commits intohexojs:masterfrom
naokiy:fix_help
Apr 17, 2015
Merged

[Bugfix] hexo help list command causes OutOfMemory#1209
tommy351 merged 5 commits intohexojs:masterfrom
naokiy:fix_help

Conversation

@naokiy
Copy link
Contributor

@naokiy naokiy commented Apr 17, 2015

$ hexo help list

Above command causes OutOfMemory.

Cause

At hexo v3.0.1, printList(title, list) (

function printList(title, list){
) has a problem.
If list have only one element, variable length becomes zero (because of the list is not sorted).

Then while (padding--){ ... } causes infinite loop.

Solution

I separate setting length from sorting.

naokiy added 2 commits April 18, 2015 00:26
Set initial value of length to avoid inifinite loop.
@coveralls
Copy link

Coverage Status

Coverage increased (+0.52%) to 95.35% when pulling a83291a on naokiy:fix_help into b460830 on hexojs:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.52%) to 95.35% when pulling 9cab139 on naokiy:fix_help into b460830 on hexojs:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.62%) to 95.44% when pulling 1c0ae1e on naokiy:fix_help into b460830 on hexojs:master.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage increased (+0.62%) to 95.44% when pulling 1c0ae1e on naokiy:fix_help into b460830 on hexojs:master.

tommy351 added a commit that referenced this pull request Apr 17, 2015
[Bugfix] `hexo help list` command causes OutOfMemory
@tommy351 tommy351 merged commit 4fa9d91 into hexojs:master Apr 17, 2015
@naokiy naokiy deleted the fix_help branch April 17, 2015 16:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants