X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Fshared%2Ffileio.c;h=3f242edc600a1b0a864820639b3073dbfb309bb4;hp=617afeace2bf0eb14930e4e60814b4326bc95ff3;hb=db5372091664c977a937f6bc0fe4484363be0669;hpb=03bb799e0b3560dca8c9b70de3dbadb0c281b36f diff --git a/src/shared/fileio.c b/src/shared/fileio.c index 617afeace..3f242edc6 100644 --- a/src/shared/fileio.c +++ b/src/shared/fileio.c @@ -209,7 +209,9 @@ static int parse_env_file_internal( switch (state) { case PRE_KEY: - if (strchr(COMMENTS, c)) + if (startswith(p, "export ")) + p+=6; + else if (strchr(COMMENTS, c)) state = COMMENT; else if (!strchr(WHITESPACE, c)) { state = KEY; @@ -255,7 +257,7 @@ static int parse_env_file_internal( break; case PRE_VALUE: - if (strchr(newline, c)) { + if (strchr(newline, c) || strchr(COMMENTS, c)) { state = PRE_KEY; key[n_key] = 0;