1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2024-10-26 12:25:09 +03:00

shell: Remove access(2) checks

The checks didn't handle stdout.

Since unistd.h wasn't included, W_OK wasn't defined and the checks
wouldn't run anyway.
This commit is contained in:
Nick Wellnhofer 2024-07-24 11:40:01 +02:00
parent aa6ca0b1d3
commit d04e152d9c

14
shell.c
View File

@ -774,13 +774,6 @@ xmllintShellWrite(xmllintShellCtxtPtr ctxt, char *filename, xmlNodePtr node,
if ((filename == NULL) || (filename[0] == 0)) {
return (-1);
}
#ifdef W_OK
if (access((char *) filename, W_OK)) {
fprintf(ctxt->output,
"Cannot write to %s\n", filename);
return (-1);
}
#endif
switch (node->type) {
case XML_DOCUMENT_NODE:
if (xmlSaveFile((char *) filename, ctxt->doc) < -1) {
@ -843,13 +836,6 @@ xmllintShellSave(xmllintShellCtxtPtr ctxt, char *filename,
filename = ctxt->filename;
if (filename == NULL)
return (-1);
#ifdef W_OK
if (access((char *) filename, W_OK)) {
fprintf(ctxt->output,
"Cannot save to %s\n", filename);
return (-1);
}
#endif
switch (ctxt->doc->type) {
case XML_DOCUMENT_NODE:
if (xmlSaveFile((char *) filename, ctxt->doc) < 0) {