Commit 416e82ce authored by Bruce Momjian's avatar Bruce Momjian

Simplify new pg_ctl newline termination code.

parent aaa6e1de
......@@ -1934,8 +1934,10 @@ adjust_data_dir(void)
pclose(fd);
free(my_exec_path);
if (strlen(filename) > 0 && filename[strlen(filename) - 1] == '\n')
filename[strlen(filename) - 1] = '\0';
/* Remove trailing newline */
if (strchr(filename, '\n') != NULL)
*strchr(filename, '\n') = '\0';
free(pg_data);
pg_data = xstrdup(filename);
canonicalize_path(pg_data);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment