Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix reference errors when getting a newsgroups listing

Thanks @fouasnon
  • Loading branch information...
commit 44b1ac1992be32318d4841d8503570823b1bb9c3 1 parent b9c1ef8
@mscdex authored
Showing with 10 additions and 9 deletions.
  1. +1 −1  README.md
  2. +8 −7 nntp.js
  3. +1 −1  package.json
View
2  README.md
@@ -15,7 +15,7 @@ Examples
### Setup/Initialization code
- var NNTP = require('./nntp'), inspect = require('util').inspect, conn;
+ var NNTPClient = require('./nntp'), inspect = require('util').inspect, conn;
// Be lazy and always exit the process on any error
function die(e) {
View
15 nntp.js
@@ -277,15 +277,16 @@ NNTP.prototype.groups = function(search, skipEmpty, cb) {
return cb(e);
var emitter = new EventEmitter();
mle.on('line', function(line) {
- var msgCount;
line = line.split(' ');
- line[1] = parseInt(line[1], 10);
- line[2] = parseInt(line[2], 10);
- msgCount = (line[1] - line[2]) + 1;
- if (line[1] === 10000000000000000 || line[2] === 10000000000000000)
+ var name = line[0],
+ first = parseInt(line[1], 10),
+ second = parseInt(line[2], 10),
+ status = line[3],
+ msgCount = (first - second) + 1;
+ if (first === 10000000000000000 || second === 10000000000000000)
msgCount += 1;
if (!skipEmpty || msgCount > 0)
- emitter.emit('group', name, count, status);
+ emitter.emit('group', name, msgCount, status);
});
mle.on('end', function() {
emitter.emit('end');
@@ -792,4 +793,4 @@ function _pipe(pair, socket) {
socket.on('error', onerror);
socket.on('close', onclose);
return cleartext;
-}
+}
View
2  package.json
@@ -1,5 +1,5 @@
{ "name": "nntp",
- "version": "0.1.0",
+ "version": "0.1.1",
"author": "Brian White <mscdex@mscdex.net>",
"description": "An NNTP client module for node.js",
"main": "./nntp",
Please sign in to comment.
Something went wrong with that request. Please try again.