=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/less/Attic/help.c,v retrieving revision 1.2 retrieving revision 1.3 diff -c -r1.2 -r1.3 *** src/usr.bin/less/Attic/help.c 2001/01/29 01:58:02 1.2 --- src/usr.bin/less/Attic/help.c 2003/04/06 23:38:07 1.3 *************** *** 1,4 **** ! /* $OpenBSD: help.c,v 1.2 2001/01/29 01:58:02 niklas Exp $ */ /* * Copyright (c) 1984,1985,1989,1994,1995 Mark Nudelman --- 1,4 ---- ! /* $OpenBSD: help.c,v 1.3 2003/04/06 23:38:07 deraadt Exp $ */ /* * Copyright (c) 1984,1985,1989,1994,1995 Mark Nudelman *************** *** 46,51 **** --- 46,52 ---- { char *helpfile; char *cmd; + size_t len; helpfile = find_helpfile(); if (helpfile == NULL) *************** *** 65,82 **** */ #if MSOFTC putenv("LESS=-m -H -+E -+s -PmHELP -- ?eEND -- Press g to see it again:Press RETURN for more., or q when done"); ! cmd = (char *) ecalloc(strlen(helpfile) + strlen(progname) + 3, ! sizeof(char)); ! sprintf(cmd, "-%s %s", progname, helpfile); #else ! cmd = (char *) ecalloc(strlen(helpfile) + strlen(progname) + 150, ! sizeof(char)); #if OS2 ! sprintf(cmd, "-%s -m -H -+E -+s \"-PmHELP -- ?eEND -- Press g to see it again:Press RETURN for more., or q when done \" %s", progname, helpfile); #else ! sprintf(cmd, "-%s -m -H -+E -+s '-PmHELP -- ?eEND -- Press g to see it again:Press RETURN for more., or q when done ' %s", progname, helpfile); #endif --- 66,83 ---- */ #if MSOFTC putenv("LESS=-m -H -+E -+s -PmHELP -- ?eEND -- Press g to see it again:Press RETURN for more., or q when done"); ! len = strlen(helpfile) + strlen(progname) + 3; ! cmd = (char *) ecalloc(len, sizeof(char)); ! snprintf(cmd, len, "-%s %s", progname, helpfile); #else ! len = strlen(helpfile) + strlen(progname) + 150; ! cmd = (char *) ecalloc(len, sizeof(char)); #if OS2 ! snprintf(cmd, len, "-%s -m -H -+E -+s \"-PmHELP -- ?eEND -- Press g to see it again:Press RETURN for more., or q when done \" %s", progname, helpfile); #else ! snprintf(cmd, len, "-%s -m -H -+E -+s '-PmHELP -- ?eEND -- Press g to see it again:Press RETURN for more., or q when done ' %s", progname, helpfile); #endif