diff options
author | lukem <lukem@pkgsrc.org> | 2001-11-20 14:53:03 +0000 |
---|---|---|
committer | lukem <lukem@pkgsrc.org> | 2001-11-20 14:53:03 +0000 |
commit | 7fb5bf88b1d31a10851fdc6eda27d336559ca647 (patch) | |
tree | f50eead5ba74b6bd2296d95b6d56c66699aff50c /sysutils/ups-nut/patches | |
parent | 4ba5d9eee5a10aa1a862972ed40f73e3706b4fe5 (diff) | |
download | pkgsrc-7fb5bf88b1d31a10851fdc6eda27d336559ca647.tar.gz |
newapc driver: chop any trailing `:'s off the end of APC_F_MINUTES fields;
specifically the RUNTIME field on my SmartUPS-1400.
Diffstat (limited to 'sysutils/ups-nut/patches')
-rw-r--r-- | sysutils/ups-nut/patches/patch-af | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/sysutils/ups-nut/patches/patch-af b/sysutils/ups-nut/patches/patch-af new file mode 100644 index 00000000000..1cc9fb42d49 --- /dev/null +++ b/sysutils/ups-nut/patches/patch-af @@ -0,0 +1,24 @@ +$NetBSD: patch-af,v 1.3 2001/11/20 14:53:04 lukem Exp $ + +--- models/newapc.c.orig Thu Oct 11 04:32:07 2001 ++++ models/newapc.c +@@ -185,11 +185,18 @@ + case APC_F_HEX: + case APC_F_DEC: + case APC_F_SECONDS: +- case APC_F_MINUTES: + case APC_F_HOURS: + case APC_F_LEAVE: + /* All of these just pass through at present */ + ptr = upsval; ++ break; ++ case APC_F_MINUTES: ++ strncpy(tmp, upsval, sizeof(tmp) - 1); ++ tmp[sizeof(tmp) - 1] = 0; ++ tval = strlen(tmp) - 1; ++ if (tmp[tval] == ':') /* cull trailing `:' */ ++ tmp[tval] = 0; ++ ptr = tmp; + break; + default: + /* Moan */ |