diff mbox

[06/10] conffile: fix striping of quotes from values.

Message ID 148117124536.31271.10187990246409032535.stgit@noble (mailing list archive)
State New, archived
Headers show

Commit Message

NeilBrown Dec. 8, 2016, 4:27 a.m. UTC
There were being stripes from the name instead!

Signed-off-by: NeilBrown <neilb@suse.com>
---
 support/nfs/conffile.c |   16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)



--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

J. Bruce Fields Dec. 14, 2016, 2:33 p.m. UTC | #1
On Thu, Dec 08, 2016 at 03:27:25PM +1100, NeilBrown wrote:
> There were being stripes from the name instead!

s/stripes/stripped/.

> 
> Signed-off-by: NeilBrown <neilb@suse.com>
> ---
>  support/nfs/conffile.c |   16 ++++++++--------
>  1 file changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/support/nfs/conffile.c b/support/nfs/conffile.c
> index 57f58a2bcdc7..e717c1e39bab 100644
> --- a/support/nfs/conffile.c
> +++ b/support/nfs/conffile.c
> @@ -300,14 +300,14 @@ conf_parse_line(int trans, char *line, size_t sz)
>  			line[strcspn (line, " \t=")] = '\0';
>  			val = line + i + 1 + strspn (line + i + 1, " \t");
>  
> -			if (line[0] == '"') {
> -				line ++;
> -				j = strcspn(line, "\"");
> -				line[j] = 0;
> -			} else if (line[0] == '\'') {
> -				line ++;
> -				j = strcspn(line, "'");
> -				line[j] = 0;
> +			if (val[0] == '"') {
> +				val ++;
> +				j = strcspn(val, "\"");
> +				val[j] = 0;
> +			} else if (val[0] == '\'') {
> +				val ++;
> +				j = strcspn(val, "'");
> +				val[j] = 0;
>  			} else {
>  				/* Skip trailing spaces and comments */
>  				for (j = 0; val[j]; j++) {
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/support/nfs/conffile.c b/support/nfs/conffile.c
index 57f58a2bcdc7..e717c1e39bab 100644
--- a/support/nfs/conffile.c
+++ b/support/nfs/conffile.c
@@ -300,14 +300,14 @@  conf_parse_line(int trans, char *line, size_t sz)
 			line[strcspn (line, " \t=")] = '\0';
 			val = line + i + 1 + strspn (line + i + 1, " \t");
 
-			if (line[0] == '"') {
-				line ++;
-				j = strcspn(line, "\"");
-				line[j] = 0;
-			} else if (line[0] == '\'') {
-				line ++;
-				j = strcspn(line, "'");
-				line[j] = 0;
+			if (val[0] == '"') {
+				val ++;
+				j = strcspn(val, "\"");
+				val[j] = 0;
+			} else if (val[0] == '\'') {
+				val ++;
+				j = strcspn(val, "'");
+				val[j] = 0;
 			} else {
 				/* Skip trailing spaces and comments */
 				for (j = 0; val[j]; j++) {