Thu Apr 23 19:53:52 2009 UTC ()
Require all plist commands to be in lower case. Nothing depends on that
and it was never documented that it worked either way, so being strict
doesn't hurt.


(joerg)
diff -r1.26 -r1.27 pkgsrc/pkgtools/pkg_install/files/lib/plist.c

cvs diff -r1.26 -r1.27 pkgsrc/pkgtools/pkg_install/files/lib/plist.c (expand / switch to unified diff)

--- pkgsrc/pkgtools/pkg_install/files/lib/plist.c 2009/04/23 19:38:14 1.26
+++ pkgsrc/pkgtools/pkg_install/files/lib/plist.c 2009/04/23 19:53:52 1.27
@@ -1,23 +1,23 @@ @@ -1,23 +1,23 @@
1/* $NetBSD: plist.c,v 1.26 2009/04/23 19:38:14 joerg Exp $ */ 1/* $NetBSD: plist.c,v 1.27 2009/04/23 19:53:52 joerg Exp $ */
2 2
3#if HAVE_CONFIG_H 3#if HAVE_CONFIG_H
4#include "config.h" 4#include "config.h"
5#endif 5#endif
6#include <nbcompat.h> 6#include <nbcompat.h>
7#if HAVE_SYS_CDEFS_H 7#if HAVE_SYS_CDEFS_H
8#include <sys/cdefs.h> 8#include <sys/cdefs.h>
9#endif 9#endif
10__RCSID("$NetBSD: plist.c,v 1.26 2009/04/23 19:38:14 joerg Exp $"); 10__RCSID("$NetBSD: plist.c,v 1.27 2009/04/23 19:53:52 joerg Exp $");
11 11
12/* 12/*
13 * FreeBSD install - a package for the installation and maintainance 13 * FreeBSD install - a package for the installation and maintainance
14 * of non-core utilities. 14 * of non-core utilities.
15 * 15 *
16 * Redistribution and use in source and binary forms, with or without 16 * Redistribution and use in source and binary forms, with or without
17 * modification, are permitted provided that the following conditions 17 * modification, are permitted provided that the following conditions
18 * are met: 18 * are met:
19 * 1. Redistributions of source code must retain the above copyright 19 * 1. Redistributions of source code must retain the above copyright
20 * notice, this list of conditions and the following disclaimer. 20 * notice, this list of conditions and the following disclaimer.
21 * 2. Redistributions in binary form must reproduce the above copyright 21 * 2. Redistributions in binary form must reproduce the above copyright
22 * notice, this list of conditions and the following disclaimer in the 22 * notice, this list of conditions and the following disclaimer in the
23 * documentation and/or other materials provided with the distribution. 23 * documentation and/or other materials provided with the distribution.
@@ -254,27 +254,27 @@ free_plist(package_t *pkg) @@ -254,27 +254,27 @@ free_plist(package_t *pkg)
254/* 254/*
255 * For an ASCII string denoting a plist command, return its code and 255 * For an ASCII string denoting a plist command, return its code and
256 * optionally its argument(s) 256 * optionally its argument(s)
257 */ 257 */
258static int 258static int
259plist_cmd(const char *s, char **arg) 259plist_cmd(const char *s, char **arg)
260{ 260{
261 const cmd_t *cmdp; 261 const cmd_t *cmdp;
262 const char *cp, *sp; 262 const char *cp, *sp;
263 char *sp2; 263 char *sp2;
264 264
265 for (cmdp = cmdv; cmdp->c_s; ++cmdp) { 265 for (cmdp = cmdv; cmdp->c_s; ++cmdp) {
266 for (sp = s, cp = cmdp->c_s; *sp && *cp; ++cp, ++sp) 266 for (sp = s, cp = cmdp->c_s; *sp && *cp; ++cp, ++sp)
267 if (tolower((unsigned char)*sp) != *cp) 267 if (*sp != *cp)
268 break; 268 break;
269 if (*cp == '\0') 269 if (*cp == '\0')
270 break; 270 break;
271 } 271 }
272 272
273 if (cmdp->c_s == NULL || arg == NULL) 273 if (cmdp->c_s == NULL || arg == NULL)
274 return cmdp->c_type; 274 return cmdp->c_type;
275 275
276 while (isspace((unsigned char)*sp)) 276 while (isspace((unsigned char)*sp))
277 ++sp; 277 ++sp;
278 *arg = xstrdup(sp); 278 *arg = xstrdup(sp);
279 if (*sp) { 279 if (*sp) {
280 sp2 = *arg + strlen(*arg) - 1; 280 sp2 = *arg + strlen(*arg) - 1;