=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/cmd-save-buffer.c,v retrieving revision 1.31 retrieving revision 1.32 diff -c -r1.31 -r1.32 *** src/usr.bin/tmux/cmd-save-buffer.c 2015/10/31 08:13:58 1.31 --- src/usr.bin/tmux/cmd-save-buffer.c 2015/11/10 22:29:33 1.32 *************** *** 1,4 **** ! /* $OpenBSD: cmd-save-buffer.c,v 1.31 2015/10/31 08:13:58 nicm Exp $ */ /* * Copyright (c) 2009 Tiago Cunha --- 1,4 ---- ! /* $OpenBSD: cmd-save-buffer.c,v 1.32 2015/11/10 22:29:33 nicm Exp $ */ /* * Copyright (c) 2009 Tiago Cunha *************** *** 103,113 **** if (args_has(self->args, 'a')) flags = "ab"; ! xasprintf(&file, "%s/%s", cwd, path); ! if (realpath(file, resolved) == NULL) ! f = NULL; else ! f = fopen(resolved, flags); free(file); if (f == NULL) { cmdq_error(cmdq, "%s: %s", resolved, strerror(errno)); --- 103,117 ---- if (args_has(self->args, 'a')) flags = "ab"; ! if (*path == '/') ! file = xstrdup(path); else ! xasprintf(&file, "%s/%s", cwd, path); ! if (realpath(file, resolved) == NULL) { ! cmdq_error(cmdq, "%s: %s", file, strerror(errno)); ! return (CMD_RETURN_ERROR); ! } ! f = fopen(resolved, flags); free(file); if (f == NULL) { cmdq_error(cmdq, "%s: %s", resolved, strerror(errno));