[Fix] `nvm ls-remote`: accept versions that end with a dot

Fixes #983.
diff --git a/nvm.sh b/nvm.sh
index 6a9b7f4..cfb29cc 100644
--- a/nvm.sh
+++ b/nvm.sh
@@ -1240,6 +1240,10 @@
   local PATTERN
   PATTERN="${3-}"
 
+  if [ "${PATTERN#"${PATTERN%?}"}" = '.' ]; then
+    PATTERN="${PATTERN%.}"
+  fi
+
   local VERSIONS
   if [ -n "${PATTERN}" ] && [ "${PATTERN}" != '*' ]; then
     if [ "${FLAVOR}" = 'iojs' ]; then
diff --git a/test/fast/Unit tests/nvm_ls_remote b/test/fast/Unit tests/nvm_ls_remote
index 2171650..be61cc4 100755
--- a/test/fast/Unit tests/nvm_ls_remote
+++ b/test/fast/Unit tests/nvm_ls_remote
@@ -40,6 +40,19 @@
 
 [ "_$OUTPUT" = "_$EXPECTED_OUTPUT" ] || die "nvm_ls_remote 0.3 did not output 0.3.x versions; got $OUTPUT"
 
+OUTPUT="$(nvm_ls_remote 0.3.)"
+EXPECTED_OUTPUT="v0.3.0
+v0.3.1
+v0.3.2
+v0.3.3
+v0.3.4
+v0.3.5
+v0.3.6
+v0.3.7
+v0.3.8"
+
+[ "_$OUTPUT" = "_$EXPECTED_OUTPUT" ] || die "nvm_ls_remote 0.3. did not output 0.3.x versions; got $OUTPUT"
+
 # Sanity checks
 OUTPUT="$(nvm_print_implicit_alias remote stable)"
 EXPECTED_OUTPUT_PATH="${MOCKS_DIR}/nvm_print_implicit_alias remote stable.txt"