Google Gruplar, artık yeni Usenet gönderilerini veya aboneliklerini desteklememektedir. Geçmişteki içerikler görüntülenebilir kalmaya devam edecek.

CF 1.1 patch #2

0 görüntüleme
İlk okunmamış mesaja atla

Jan-Piet Mens

okunmadı,
19 Oca 1993 14:41:2519.01.1993
alıcı
System: CF version 1.1
Patch #: 2
Priority: MEDIUM
Subject: Added MSDOS support
Date: Tue Jan 19 19:40:20 MET 1993
From: Jan-Piet Mens <j...@Logix.DE>

Description:
Added MSDOS support
Fixed bug in length comparison of strings
Added MSDOS support (take everything out :-)
Removed 'continue' from awk program

Fix: From rn, say "| patch -p -N -d DIR", where DIR is your CF source
directory. Outside of rn, say "cd DIR; patch -p -N <thisarticle".
If you don't have the patch program, apply the following by hand,
or get patch (version 2.0, latest patchlevel).

After patching:
Configure -d
make
make install

If patch indicates that patchlevel is the wrong version, you may need
to apply one or more previous patches, or the patch may already
have been applied. See the patchlevel.h file to find out what has or
has not been applied. In any event, don't continue with the patch.

If you are missing previous patches they can be obtained from me:

Jan-Piet Mens <j...@Logix.DE>

Index: patchlevel.h
Prereq: 1
1c1
< #define PATCHLEVEL 1
---
> #define PATCHLEVEL 2

Index: conf.c
Prereq: 1.1
*** conf.c.old Tue Jan 19 19:39:52 1993
--- conf.c Tue Jan 19 19:39:52 1993
***************
*** 9,17 ****
#include "cf.h"

/*
! * $Header: /home/jpm/src/cf/RCS/conf.c,v 1.1 1993/01/18 14:47:48 jpm Exp $
*
* $Log: conf.c,v $
* Revision 1.1 1993/01/18 14:47:48 jpm
* Initial revision
*
--- 9,21 ----
#include "cf.h"

/*
! * $Header: /home/jpm/src/cf/RCS/conf.c,v 1.1.1.1 1993/01/19 19:38:06 jpm Exp $
*
* $Log: conf.c,v $
+ * Revision 1.1.1.1 1993/01/19 19:38:06 jpm
+ * patch2: Added MSDOS support
+ * patch2: Fixed bug in length comparison of strings
+ *
* Revision 1.1 1993/01/18 14:47:48 jpm
* Initial revision
*
***************
*** 37,45 ****
--- 41,51 ----
# define MAXPATHLEN 256
#endif

+ #ifndef MSDOS
#ifndef CPP
# define CPP "/lib/cpp"
#endif
+ #endif

nl_catd cat;
char _filename[MAXPATHLEN]; /* Current config file */
***************
*** 54,60 ****
int cf_init(list)
cfent *list;
{
! static char rcs_id[] = "@(#)$Id: conf.c,v 1.1 1993/01/18 14:47:48 jpm Exp $";
cfent *cl;

for (cl = list; cl && cl->name; cl++) {
--- 60,66 ----
int cf_init(list)
cfent *list;
{
! static char rcs_id[] = "@(#)$Id: conf.c,v 1.1.1.1 1993/01/19 19:38:06 jpm Exp $";
cfent *cl;

for (cl = list; cl && cl->name; cl++) {
***************
*** 104,109 ****
--- 110,116 ----
files[i], errno, strerror(errno));
continue; /* Won't reach if CF_ERREXIT set */
}
+ #ifndef MSDOS
(void)fclose(fp);
if ((fp = cpp_popen(CPP, _filename, 0)) == (FILE *)0) {
cf_error(nlm(cfSet, CantStartCpp),
***************
*** 110,117 ****
--- 117,129 ----
CPP, errno, strerror(errno));
continue;
}
+ #endif /* MSDOS */
parse(fp);
+ #ifndef MSDOS
cpp_pclose(fp);
+ #else
+ fclose(fp);
+ #endif
}
return (CF_OK);
}
***************
*** 164,174 ****
_cmin(sp), _cmax(sp));
break;
case t_dbl:
! _cdouble(sp)= atof(val);
break;
case t_str:
n = strlen(value);
! if ((n <= _cmin(sp)) && (n <= _cmax(sp)))
{
if (_cstring(sp) && *_cstring(sp))
free(_cstring(sp));
--- 176,187 ----
_cmin(sp), _cmax(sp));
break;
case t_dbl:
! _cdouble(sp) = atof(val);
break;
case t_str:
n = strlen(value);
! TRACE(("strlen(%s) == %d\n", value, n));
! if ((n >= _cmin(sp)) && (n <= _cmax(sp)))
{
if (_cstring(sp) && *_cstring(sp))
free(_cstring(sp));
***************
*** 208,216 ****
}
else {
if (is_bool)
! cf_inst(token, t_bol, 0, 1, (char *)&var_is_true);
else
! cf_inst(token, t_str, 1, strlen(value), value);
}
}
return (rc);
--- 221,229 ----
}
else {
if (is_bool)
! cf_inst(token, t_bol, (long)0, (long)1, (char *)&var_is_true);
else
! cf_inst(token, t_str, (long)1, (long)strlen(value), value);
}
}
return (rc);
***************
*** 232,237 ****
--- 245,252 ----
FILE *fp;
extern char _filename[];

+ TRACE(("cf_fname(%s, %s)", fname, mode));
+
/*
* If the first char is a slash or the first two chars are "./" then
* just return the open (or not so open) file.
***************
*** 248,259 ****
* I have to save the content of `p', since it will be destroyed by
* strtok().
*/

strcpy(path, p);
! for (pc = strtok(path, ":"); pc != (char *)0; pc = strtok(NULL, ":"))
{
sprintf(fullpath, "%s/%s", pc, fname);
! TRACE(("Try: cf_fname(%s)", fullpath));
if ((fp = fopen(fullpath, mode)) != (FILE *)0) {
TRACE(("Succeeded: cf_fname(%s)", fullpath));
strcpy(_filename, fullpath);
--- 263,279 ----
* I have to save the content of `p', since it will be destroyed by
* strtok().
*/
+ #ifdef MSDOS
+ # define PCHARS ";"
+ #else
+ # define PCHARS ":"
+ #endif

strcpy(path, p);
! for (pc = strtok(path, PCHARS); pc != (char *)0; pc = strtok(NULL, PCHARS))
{
sprintf(fullpath, "%s/%s", pc, fname);
! TRACE(("Try: cf_fname(%s, %s)", fullpath, mode));
if ((fp = fopen(fullpath, mode)) != (FILE *)0) {
TRACE(("Succeeded: cf_fname(%s)", fullpath));
strcpy(_filename, fullpath);

Index: pipe.c
Prereq: 1.1
*** pipe.c.old Tue Jan 19 19:39:56 1993
--- pipe.c Tue Jan 19 19:39:57 1993
***************
*** 1,3 ****
--- 1,5 ----
+ #ifndef MSDOS
+
#include <stdio.h>
#include "config.h"
#include "cf.h"
***************
*** 17,25 ****
#include <unistd.h>

/*
! * $Header: /home/jpm/src/cf/RCS/pipe.c,v 1.1 1993/01/18 14:47:53 jpm Exp $
*
* $Log: pipe.c,v $
* Revision 1.1 1993/01/18 14:47:53 jpm
* Initial revision
*
--- 19,30 ----
#include <unistd.h>

/*
! * $Header: /home/jpm/src/cf/RCS/pipe.c,v 1.1.1.1 1993/01/19 19:38:24 jpm Exp $
*
* $Log: pipe.c,v $
+ * Revision 1.1.1.1 1993/01/19 19:38:24 jpm
+ * patch2: Added MSDOS support (take everything out :-)
+ *
* Revision 1.1 1993/01/18 14:47:53 jpm
* Initial revision
*
***************
*** 84,90 ****
va_dcl
#endif
{
! static char rcs_id[] = "@(#)$Id: pipe.c,v 1.1 1993/01/18 14:47:53 jpm Exp $";
va_list ap;
FILE *fp;
char *args[MAXARGS];
--- 89,95 ----
va_dcl
#endif
{
! static char rcs_id[] = "@(#)$Id: pipe.c,v 1.1.1.1 1993/01/19 19:38:24 jpm Exp $";
va_list ap;
FILE *fp;
char *args[MAXARGS];
***************
*** 216,218 ****
--- 221,225 ----
cpp_pclose(fp);
}
#endif
+
+ #endif /* !MSDOS */

Index: README
*** README.old Tue Jan 19 19:39:58 1993
--- README Tue Jan 19 19:39:59 1993
***************
*** 1,4 ****
! This is CF version 1.1 PL0

CF is a library of routines that can be incorporated into an application for
reading configuration profiles for an application. A sample configuration
--- 1,4 ----
! This is CF version 1.1

CF is a library of routines that can be incorporated into an application for
reading configuration profiles for an application. A sample configuration
***************
*** 31,33 ****
--- 31,44 ----
for further info.

-JP
+
+ ------------------------------------
+ From: Ian Stewartson <iste...@datlog.co.uk>
+ Tue, 19 Jan 1993 15:59:06 +0000 (GMT)
+
+ In genincl, neither the System V.4 awk or GNU awk like the 'continue;'
+ statement at line 19 of the awk script. Remove the line and the build
+ appears to work OK.
+
+ I was building on a sparc System V.4 machine (ICL DRS 6000).
+

Index: nls/genincl.SH
*** nls/genincl.SH.old Tue Jan 19 19:40:02 1993
--- nls/genincl.SH Tue Jan 19 19:40:02 1993
***************
*** 168,174 ****
printf("\n#define %sSet (%d)\n", $3, $2)
}
}
- continue;
}

# If we have a "$ " (dollar-space), it is a comment in the messages
--- 168,173 ----

*** End of Patch 2 ***
--
__ _____ __ __
| || _ \ | \/ | Logix GmbH +49-611-309797
__| || ___/ | | Moritzstrasse 50 j...@Logix.DE
|_____||__| |__||__| D-6200 Wiesbaden ...!uunet!mcsun!unido!logixwi!jpm

0 yeni ileti