чување 5dba73998348ce28d408005b39e572f77db7a2a3
родитељ fc89c76c65331cc25f777f4fc6cad0beb557f82c
Аутор: Страхиња Радић <contact@strahinja.org>
Датум: Tue, 2 Feb 2021 22:40:12 +0100
Reverted WIP for var propagation from includes
Signed-off-by: Страхиња Радић <contact@strahinja.org>
Diffstat:
измењених датотека: 2, додавања: 3(+), брисања: 10(-)
diff --git a/index.html b/index.html
@@ -136,7 +136,7 @@ this program. If not, see <<a href="https://www.gnu.org/licenses">https://www
<div id="git-log">
Previous commit:
-index.slw 23859ca 2021-02-02 07:14:15 +0100 (Страхиња Радић) (HEAD -> master, origin/master, origin/HEAD)
+index.slw fc89c76 2021-02-02 20:13:15 +0100 (Страхиња Радић) (HEAD -> master, origin/master, origin/HEAD)
</div><!--git-log-->
diff --git a/slweb.c b/slweb.c
@@ -767,7 +767,7 @@ int
process_include(uint8_t* token, FILE* output, BOOL read_yaml_macros_and_links)
{
if (read_yaml_macros_and_links)
- return 0;
+ return 0;
if (!input_filename)
return warning(1, (uint8_t*)"Cannot use 'include' in stdin");
@@ -775,25 +775,20 @@ process_include(uint8_t* token, FILE* output, BOOL read_yaml_macros_and_links)
uint8_t* ptoken = u8_strchr(token, (ucs4_t)' ');
char* include_filename = NULL;
char* pinclude_filename = NULL;
- int var_pipe_fds[2];
if (!ptoken)
exit(error(1, (uint8_t*)"Directive 'include' requires"
" an argument"));
- pipe(var_pipe_fds);
fflush(output);
pid_t pid = fork();
int pstatus = 0;
if (pid > 0)
- {
- close(var_pipe_fds[PIPE_WRITE_INDEX]);
wait(&pstatus);
- }
else if (pid == 0)
{
- close(var_pipe_fds[PIPE_READ_INDEX]);
+ prctl(PR_SET_PDEATHSIG, SIGTERM);
CALLOC(include_filename, char, BUFSIZE)
pinclude_filename = include_filename;
@@ -854,7 +849,6 @@ process_include(uint8_t* token, FILE* output, BOOL read_yaml_macros_and_links)
free(buffer);
return result;
}
-
state = ST_NONE;
current_footnote = 0;
current_inline_footnote = 0;
@@ -871,7 +865,6 @@ process_include(uint8_t* token, FILE* output, BOOL read_yaml_macros_and_links)
else
exit(error(1, (uint8_t*)"Fork failed"));
-
return 0;
}