soloscli: fix new lines in soloscli
authorFlorian Fainelli <florian@openwrt.org>
Thu, 2 Jun 2011 14:38:01 +0000 (14:38 +0000)
committerFlorian Fainelli <florian@openwrt.org>
Thu, 2 Jun 2011 14:38:01 +0000 (14:38 +0000)
If the string received from the ADSL firmware is missing \n, add it in.

Signed-off-by: Nathan Williams <nathan@traverse.com.au>
SVN-Revision: 27096

package/soloscli/Makefile
package/soloscli/patches/001-newline.patch

index 1c2d998090d3c117f73fff398c20cdbdf442d1a8..490186dbecedc9b48f5e1f4408e599b46b207272 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2006-2010 OpenWrt.org
+# Copyright (C) 2006-2011 OpenWrt.org
 #
 # This is free software, licensed under the GNU General Public License v2.
 # See /LICENSE for more information.
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=soloscli
 PKG_VERSION:=0.11
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=solos-pci-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=@SF/openadsl
index 69cd5b28a6aa08a729285a05dda21e45b3ca4422..4b663e88988993856ed1a09c56ce69e5f4636335 100644 (file)
@@ -1,11 +1,15 @@
 --- a/soloscli/soloscli.c
 +++ b/soloscli/soloscli.c
-@@ -238,7 +238,7 @@
+@@ -238,7 +238,11 @@
        }
        if (strcmp(buf,pid) == 0) {
  /*            printf("Sequence matches.\n"); */
 -              printf("%s",bufp);
-+              printf("%s\n",bufp);
++              if(buf[(len-1)] == '\n'){
++                      printf("%s",bufp);
++              } else {
++                      printf("%s\n",bufp);
++              }
        } else {
                printf("Sequence incorrect.\n");
                buf[i] = '\n';