Update of /cvsroot/refdb/refdb/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6892
Modified Files:
backend-html.c
Log Message:
assorted p element fixes
Index: backend-html.c
===================================================================
RCS file: /cvsroot/refdb/refdb/src/backend-html.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -U2 -r1.24 -r1.25
--- backend-html.c 28 Jan 2004 00:18:14 -0000 1.24
+++ backend-html.c 16 Mar 2004 21:03:27 -0000 1.25
@@ -165,4 +165,5 @@
int errcode; /* receives error code for periodical requests */
int nhave_booktitle = 0;
+ int nhave_para = 0;
char have_page = 0;
char have_author = 0;
@@ -497,4 +498,14 @@
}
}
+ else {
+ if ((new_ref = mstrcat(*(ptr_rendinfo->ptr_ref), "<p>", ptr_rendinfo->ptr_ref_len, 0)) == NULL) {
+ LOG_PRINT(LOG_WARNING, outomem.text);
+ clean_request(dbires);
+ return NULL;
+ }
+ else {
+ *(ptr_rendinfo->ptr_ref) = new_ref;
+ }
+ }
have_author = 0;
@@ -547,10 +558,20 @@
}
}
- else {
+ else { /* not book et al. */
+
/*----------------------------------------------------------------*/
/* periodical */
+ nhave_para = 1;
+ if ((new_ref = mstrcat(*(ptr_rendinfo->ptr_ref), "<p>", ptr_rendinfo->ptr_ref_len, 0)) == NULL) {
+ LOG_PRINT(LOG_WARNING, outomem.text);
+ return NULL;
+ }
+ else {
+ *(ptr_rendinfo->ptr_ref) = new_ref;
+ }
+
/* fetch journal of this article */
if ((item = get_periodical(dbi_result_get_conn(ptr_rendinfo->dbires), date_buffer, NULL, 4, &errcode, my_dbi_result_get_idval(ptr_rendinfo->dbires, "refdb_id"))) != NULL) {
- if ((new_ref = mstrcat(*(ptr_rendinfo->ptr_ref), "<p><em class='periodical'>", ptr_rendinfo->ptr_ref_len, 0)) == NULL) {
+ if ((new_ref = mstrcat(*(ptr_rendinfo->ptr_ref), "<em class='periodical'>", ptr_rendinfo->ptr_ref_len, 0)) == NULL) {
LOG_PRINT(LOG_WARNING, outomem.text);
return NULL;
@@ -695,11 +716,14 @@
}
}
-/* if ((new_ref = mstrcat(*(ptr_rendinfo->ptr_ref), "</p>\n", ptr_rendinfo->ptr_ref_len, 0)) == NULL) { */
-/* LOG_PRINT(LOG_WARNING, outomem.text); */
-/* return NULL; */
-/* } */
-/* else { */
-/* *(ptr_rendinfo->ptr_ref) = new_ref; */
-/* } */
+
+ if (nhave_para) {
+ if ((new_ref = mstrcat(*(ptr_rendinfo->ptr_ref), "</p>\n", ptr_rendinfo->ptr_ref_len, 0)) == NULL) {
+ LOG_PRINT(LOG_WARNING, outomem.text);
+ return NULL;
+ }
+ else {
+ *(ptr_rendinfo->ptr_ref) = new_ref;
+ }
+ }
/*----------------------------------------------------------------*/
|