]> Cypherpunks.ru repositories - goredo.git/blobdiff - main.go
Proper case of variable name
[goredo.git] / main.go
diff --git a/main.go b/main.go
index 41d8d30f0ded6473b600938207d1890e323ae74f..03a73d448334295d8aa4e7a04f5a6b46c59f9a88 100644 (file)
--- a/main.go
+++ b/main.go
@@ -198,7 +198,7 @@ func main() {
        LogLock = os.Getenv(EnvLogLock) == "1"
        LogJS = os.Getenv(EnvLogJS) == "1"
        if Debug || os.Getenv(EnvLogPid) == "1" {
-               MyPid = os.Getpid()
+               MyPID = os.Getpid()
        }
        var traced bool
        if flagTraceAll != nil && *flagTraceAll {
@@ -507,7 +507,7 @@ func main() {
                DepFixHashCache = make(map[string]Hash)
                err = depFix(Cwd)
        case CmdNameRedoInode:
-               var inode Inode
+               var inode *Inode
                for _, tgt := range tgts {
                        inode, err = inodeFromFileByPath(tgt.a)
                        if err != nil {
@@ -542,6 +542,7 @@ func main() {
                }
                var typ byte
                var chunk []byte
+               var inode Inode
                for len(data) > 0 {
                        typ, chunk, data, _ = chunkRead(data)
                        switch typ {
@@ -561,7 +562,7 @@ func main() {
                                }...)
                        case DepTypeIfchange:
                                name := string(chunk[InodeLen+HashLen:])
-                               meta := string(chunk[:InodeLen+HashLen])
+                               meta := chunk[:InodeLen+HashLen]
                                fields := []recfile.Field{
                                        {Name: "Type", Value: "ifchange"},
                                        {Name: "Target", Value: name},
@@ -569,9 +570,10 @@ func main() {
                                fields = append(fields, recfile.Field{
                                        Name: "Hash", Value: Hash(meta[InodeLen:]).String(),
                                })
-                               fields = append(fields, Inode(meta[:InodeLen]).RecfileFields()...)
+                               inode = Inode(meta[:][:InodeLen])
+                               fields = append(fields, inode.RecfileFields()...)
                                err = recfileWrite(w, fields...)
-                       case DepTypeIfchangeDummy:
+                       case DepTypeIfchangeNonex:
                                err = recfileWrite(w, []recfile.Field{
                                        {Name: "Type", Value: "ifchange"},
                                        {Name: "Target", Value: string(chunk)},