From b57959fe8a3982c5e55e88deaeeab25c48d1391c Mon Sep 17 00:00:00 2001 From: sjplimp Date: Mon, 27 Sep 2010 17:33:53 +0000 Subject: [PATCH] git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@4867 f3b2605a-c512-4ea7-a41b-209d697bcdaa --- src/input.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/input.cpp b/src/input.cpp index 99d996e405..82daa8d5e0 100644 --- a/src/input.cpp +++ b/src/input.cpp @@ -623,14 +623,17 @@ void Input::jump() } if (me == 0) { - if (infile != stdin) fclose(infile); - infile = fopen(arg[0],"r"); - if (infile == NULL) { - char str[128]; - sprintf(str,"Cannot open input script %s",arg[0]); - error->one(str); + if (strcmp(arg[0],"SELF") == 0) rewind(infile); + else { + if (infile != stdin) fclose(infile); + infile = fopen(arg[0],"r"); + if (infile == NULL) { + char str[128]; + sprintf(str,"Cannot open input script %s",arg[0]); + error->one(str); + } + infiles[nfile-1] = infile; } - infiles[nfile-1] = infile; } if (narg == 2) {