X-Git-Url: http://www.privoxy.org/gitweb/?a=blobdiff_plain;f=cgiedit.c;h=db16c5105707f59f6251670e2bb4e6e9945c4b0e;hb=2fdcad5d38e5a63296391ab509c72181b6a1d04a;hp=54c44ec15f28506fe4012bde5e1b37332a6e6cda;hpb=7cadc7d4799218b7c62e48efec14729390039cc1;p=privoxy.git diff --git a/cgiedit.c b/cgiedit.c index 54c44ec1..db16c510 100644 --- a/cgiedit.c +++ b/cgiedit.c @@ -1,4 +1,4 @@ -const char cgiedit_rcs[] = "$Id: cgiedit.c,v 1.11 2002/01/23 01:03:31 jongfoster Exp $"; +const char cgiedit_rcs[] = "$Id: cgiedit.c,v 1.13 2002/03/04 02:07:59 david__schmidt Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/cgiedit.c,v $ @@ -42,6 +42,12 @@ const char cgiedit_rcs[] = "$Id: cgiedit.c,v 1.11 2002/01/23 01:03:31 jongfoster * * Revisions : * $Log: cgiedit.c,v $ + * Revision 1.13 2002/03/04 02:07:59 david__schmidt + * Enable web editing of actions file on OS/2 (it had been broken all this time!) + * + * Revision 1.12 2002/03/03 09:18:03 joergs + * Made jumbjuster work on AmigaOS again. + * * Revision 1.11 2002/01/23 01:03:31 jongfoster * Fixing gcc [CygWin] compiler warnings * @@ -703,7 +709,7 @@ jb_err edit_write_file(struct editable_file * file) assert(file); assert(file->filename); -#ifdef AMIGA +#if defined(AMIGA) || defined(__OS2__) if (NULL == (fp = fopen(file->filename, "w"))) #else if (NULL == (fp = fopen(file->filename, "wt"))) @@ -1534,7 +1540,7 @@ jb_err edit_read_file(struct client_state *csp, } } -#ifdef AMIGA +#if defined(AMIGA) || defined(__OS2__) if (NULL == (fp = fopen(filename,"r"))) #else if (NULL == (fp = fopen(filename,"rt"))) @@ -1737,7 +1743,9 @@ static jb_err get_file_name_param(struct client_state *csp, { const char *param; const char *s; +#if 0 /* Patch to make 3.0.0 work properly. */ char *name; +#endif /* 0 - Patch to make 3.0.0 work properly. */ char *fullpath; char ch; int len; @@ -1781,6 +1789,13 @@ static jb_err get_file_name_param(struct client_state *csp, } } + /* + * FIXME Following is a hack to make 3.0.0 work properly. + * Change "#if 0" --> "#if 1" below when we have modular action + * files. + * -- Jon + */ +#if 0 /* Patch to make 3.0.0 work properly. */ /* Append extension */ name = malloc(len + strlen(suffix) + 1); if (name == NULL) @@ -1793,6 +1808,16 @@ static jb_err get_file_name_param(struct client_state *csp, /* Prepend path */ fullpath = make_path(csp->config->confdir, name); free(name); +#else /* 1 - Patch to make 3.0.0 work properly. */ + if ((csp->actions_list == NULL) + || (csp->actions_list->filename == NULL)) + { + return JB_ERR_CGI_PARAMS; + } + + fullpath = ( (csp->actions_list && csp->actions_list->filename) + ? strdup(csp->actions_list->filename) : NULL); +#endif /* 1 - Patch to make 3.0.0 work properly. */ if (fullpath == NULL) { return JB_ERR_MEMORY;